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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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))

Regards
Zubair

Please try my custom visuals
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.