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
adamnimmo
Helper I
Helper I

Summarized count of past due orders

Hello all, I am trying to create a single card visual which displays a count of my past due orders.

My dataset is setup with a colume of 'Order No' which lists the same value multiple times based on the items within the order, I then have a column 'Order Date' and 'Est Delivery Date' lastly a calculated column 'PastDue' which populates based on 'Order Date < Today()'.

My problem is when creating this card/visual and using the field of 'PastDue' and the count calculation my results are skewed since it is counting each instance, whereas I need it to only count each instace based on a distinct order number.

1 ACCEPTED SOLUTION

Thanks @v-yuezhe-msftI actually was able to overcome the calcuation issue by creating a helper table which I then created a summarized listing of my orders/dates to allow the calculation to work.

View solution in original post

6 REPLIES 6
v-yuezhe-msft
Employee
Employee

@adamnimmo,


Right click your table and select “New Measure”, apply the following formula. Then drag the measure to a Card visual to check if you get expected result.

Measure  = CALCULATE(DISTINCTCOUNT(Table[Order No]),FILTER(Table, Table[Order Date]<TODAY()))

If the above DAX doesn’t help, please share sample data of your table and post desired result here.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you all for your help, I am able to get this working within a test environment, however it doesn't work with my live data for some reason. I believe it is in the way it is intially formatted so I will continue working with it.

@adamnimmo,

You can post error message and share sample data of the table for us to analyze.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-yuezhe-msftI actually was able to overcome the calcuation issue by creating a helper table which I then created a summarized listing of my orders/dates to allow the calculation to work.

Ashish_Mathur
Super User
Super User

Hi,

 

Use this calculated field formula

 

=DISTINCTCOUNT(Data[Order No])

 

Hope this helps.


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

Sample data would be hugely beneficial.

 

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ 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...

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.