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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Dax for Get count of distinct rows from measure

my table is below

 

Column1    Coulmn2

A                     1 

A                     1

A                     2

A                     2
A                     2
A                     3

 

output will be 3 as there are 3 unique rows.

 

Note: My source is tabular model so i can create only measures in power BI

2 ACCEPTED SOLUTIONS
gooranga1
Power Participant
Power Participant

Hi @Anonymous 

 

Create a calculated column that concatenates Column1 and 2 then distinct count that.

 

Count = Table1[Column1 ] & Table1[Coulmn2]
DistinctRows = CALCULATE(DISTINCTCOUNT(Table1[Count]))

data4.PNG

View solution in original post

v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

One sample for your reference. Here we can create a measure as below.

 

Measure = SUMX(VALUES(Table1[Column1]),CALCULATE(DISTINCTCOUNT(Table1[Column2])))

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

One sample for your reference. Here we can create a measure as below.

 

Measure = SUMX(VALUES(Table1[Column1]),CALCULATE(DISTINCTCOUNT(Table1[Column2])))

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

May be a MEASURE like

 

Measure = Countrows(DISTINCT(TableName))
gooranga1
Power Participant
Power Participant

Hi @Anonymous 

 

Create a calculated column that concatenates Column1 and 2 then distinct count that.

 

Count = Table1[Column1 ] & Table1[Coulmn2]
DistinctRows = CALCULATE(DISTINCTCOUNT(Table1[Count]))

data4.PNG

tex628
Community Champion
Community Champion

Request is a little bit vague but a DISTINCTCOUNT([Column2]) should work i believe?

Br,
Johannes


Connect on LinkedIn

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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