A window function in computing allows for the performance of calculations across a set of table rows that are somehow related to the current row, providing a way to perform complex data analysis tasks without the need for subqueries or temporary tables. These functions are crucial in SQL for tasks like calculating running totals, moving averages, and ranking data within partitions of a dataset.