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

Sum of distinct text value

Hello -  

 

This is probably an easy one, but I've tried various distinct count, count rows, etc and nothing has worked yet.  

 

I have a Sales Orders table.   In that table is the Order #  and a new calculated column that identifies the order as either late, or not late, based on a DateDiff formula (from another column).    If the due date is yesterday or beyond...then the Order is late  (because it has missed its ship date.  

 

I can get a toal count of all rows by using this.    But this sums to 108 which is summing up all of the orders (and some orders have multiple lines).   

Total Late =
CALCULATE ( COUNTROWS (Operations_Backlog), Operations_Backlog[Late or Not Due Yet] = "Late" )

 

The value I am looking for should be 64....which is the distinct order count of late orders.    (Just a coincidence that it happens to be half of the 108).

 

I need a formula (measure) that gives me the true total of late orders, based on the unique Order #.  

 

Thanks!   

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Everyone:   I got the measure to work by using this: 

 

New Measure = CALCULATE(DISTINCTCOUNT(Operations_Backlog[Order]),Operations_Backlog[Late or Not Due Yet]="Late")
 
Works perfectly. And I created another meausure, just changed "Late" to "Not Due Yet" and so I now I can track both using a measure instead of having to place a filter visual on my page.
 
Thanks Everyone!! Love the Power Bi community forum...always so helpful!

 

 

 

View solution in original post

11 REPLIES 11

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.