Forum, Tips & Tricks

Learn tips and tricks and engage in discussions with our blog authors here. It’s all for your benefit and learning. 

Forum breadcrumbs - You are here:ForumTips & Tricks: Power BIGrouping by
You need to log in to create posts and topics.

Grouping by

One of the necessities to master while performing even simple data analysis is to carry out the calculation on specific group, i.e. #Groupby

In Power BI, such is done by functions ALLEXCEPT and CALCULATE. Here is an example. Let´s say we want to calculate the number of people within different departments of the company in different time spans. The simple formula for that is as follows:

Count_people = CALCULATE(DISTINCTCOUNT(Report[employee_number]);ALLEXCEPT(Report;Report[Days];Report[Departments]))

 

Combination of CALCULATE and DISTINCTCOUNT calculates the number, ALLEXCEPT specifies by which groups. Straightforward, right?