nilsinelabore
nilsinelabore

Reputation: 5155

Filter, Group by, and count unique values in each group in Power BI

How can I filter where State = AA, group by Store and count the number of unique values in Item in Power BI?

    YearMonth   State   Store   Qty  Sales          Item
0   2020-06     AA      JW442   1.0  100            SP006
1   2020-06     AA      JW442   1.0  1200           SP007
2   2019-09     CC      JW600   4.0  700            SP020
3   2019-05     AA      JW100   5.0  30             SP00
4   2019-05     AA      JW100   4.0  8500           SP5
                                ...

Upvotes: 0

Views: 1709

Answers (1)

msta42a
msta42a

Reputation: 3741

Try this measure:

 Measure = CALCULATE( COUNTROWS(values(tabx[Item])), filter(ALL('tabx'[State]), 'tabx'[State] = "AA"))

enter image description here

Upvotes: 1

Related Questions