Forum Discussion
_Alex_
7 years agoNew Member
DAX Help: Unique count by row II
Suppose I have a dataset as follows:
Car_ID Owner_Name Car_Owner_State Unique_State_Count
1 Adam FL 2
1 Bob FL 2
1 Carrie GA 2
2 Alex NC 1
2 Bill NC 1
3 Aron IL 1
What DAX expression would produce the column "Unique_State_Count" above?
Thank you!
Hi _Alex_
Created calculated column
Unique_State_Count1 = CALCULATE(DISTINCTCOUNT(Table1[ Car_Owner_State]),ALLEXCEPT(Table1,Table1[Car_ID]))
Or measure
Measure = CALCULATE(DISTINCTCOUNT(Table1[ Car_Owner_State]),ALLEXCEPT(Table1,Table1[Car_ID]))
Best Regards
maggie
2 Replies
- Zubair_MuhammadCommunity ChampionHi
Try with
Calculate(distinctcount (table1[carownerstate]), allexcept (table1,table1 [car id])) - v-juanli-msftCommunity Support
Hi _Alex_
Created calculated column
Unique_State_Count1 = CALCULATE(DISTINCTCOUNT(Table1[ Car_Owner_State]),ALLEXCEPT(Table1,Table1[Car_ID]))
Or measure
Measure = CALCULATE(DISTINCTCOUNT(Table1[ Car_Owner_State]),ALLEXCEPT(Table1,Table1[Car_ID]))
Best Regards
maggie