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
mattthew
Frequent Visitor

Distinct count of two distinct values?

 Hi all,

I wsa hoping there's a solution to this requirement.  I have a list of total orders with two distinct measures.  Needing a distinct count of the two distinct measures. 


The first measure shows below.  It takes the distinct count of orders for one column called 'On Time'

 IT.PNG

 The second measure shows below.  It takes the distinct count of 'In Full'

OT.PNG 

 

 

 They utilize the measure Total Count which in itself is a distinct count.

TotalCount.PNG

 

 

 

 

 

The problem i run into is of the 80 'In Full' and '70' On Time there are 10 duplicates.  Is there a DAX formula that could distinguish 'of the two measures there are this many duplicates' and only count them as 1?

Issue.png

 

 

 

1 ACCEPTED SOLUTION

Thanks for the hint and this certainly helped me rethink it.

 

I was able to resolve this by using CALCULATE(COUNTROWS, FILTER) 

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Share a dataset and show the expected result.  It becomes a lot easier to understand a question when one shares data rather than formulas.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

Could you just FILTER your SUMX tables to exclude In Full or On Time respectively?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks for the hint and this certainly helped me rethink it.

 

I was able to resolve this by using CALCULATE(COUNTROWS, FILTER) 

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.