Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
_Alex_
New 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!

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @_Alex_

Created calculated column

Unique_State_Count1 = CALCULATE(DISTINCTCOUNT(Table1[ Car_Owner_State]),ALLEXCEPT(Table1,Table1[Car_ID]))

4.png

 

Or measure

Measure = CALCULATE(DISTINCTCOUNT(Table1[ Car_Owner_State]),ALLEXCEPT(Table1,Table1[Car_ID]))

 

Best Regards

maggie

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @_Alex_

Created calculated column

Unique_State_Count1 = CALCULATE(DISTINCTCOUNT(Table1[ Car_Owner_State]),ALLEXCEPT(Table1,Table1[Car_ID]))

4.png

 

Or measure

Measure = CALCULATE(DISTINCTCOUNT(Table1[ Car_Owner_State]),ALLEXCEPT(Table1,Table1[Car_ID]))

 

Best Regards

maggie

Zubair_Muhammad
Community Champion
Community Champion

Hi

Try with

Calculate(distinctcount (table1[carownerstate]), allexcept (table1,table1 [car id]))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors
Users online (2,457)