Forum Discussion
Anonymous
3 years agoNot applicable
Count distinct values in one column, grouped by another column
I'm quite new to Power BI and I think this is probably very easy, but I've been trying to work out a solution for several days an I can't work it out. My data consists of a top-level category (un...
- 3 years ago
HI Anonymous ,
You can create a calculated column in Power BI using the following DAX measure:
Count of Type by Make = // calculated column to get count of Type by Make CALCULATE( COUNT('Model Data'[Type]), // counting the Type FILTER( 'Model Data', // filtering the table to get the count of type groupoed by Make 'Model Data'[Make] = EARLIER('Model Data'[Make]) ) )You will get the result as follows:
Hope this helps.
Pragati11
Super User
3 years agoHI Anonymous ,
You can create a calculated column in Power BI using the following DAX measure:
Count of Type by Make = // calculated column to get count of Type by Make
CALCULATE(
COUNT('Model Data'[Type]), // counting the Type
FILTER(
'Model Data', // filtering the table to get the count of type groupoed by Make
'Model Data'[Make] = EARLIER('Model Data'[Make])
)
)
You will get the result as follows:
Hope this helps.
- Anonymous3 years agoNot applicable
Perfect! Thanks Pragati 😀