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 values in column on Unique value

OrderIDOrderTotalItem
0001231000078
0001231000081
0001231000096
000789590078

 

The Total returned for order 000123 was 300 when it really should be 100. So the totals for all orders returned as 359 when really it was 159.

 

I tried the following DAX code but it returned all 0's.  I want to be abel to return the sum of OrderTotals for only unique OrderID's. 

Total = SUMX(DISTINCT(Data[OrderID]), FIRSTNONBLANK(Data[OrderTotal], 0))

 

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @Anonymous 

I restore your data and create a sample , the sum of [OrderID] is 159 . I have attached my pbix file , you can refer to it and check the original data in your sample .

Ailsamsft_0-1644226742311.png

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yetao1-msft
Community Support
Community Support

Hi @Anonymous 

I restore your data and create a sample , the sum of [OrderID] is 159 . I have attached my pbix file , you can refer to it and check the original data in your sample .

Ailsamsft_0-1644226742311.png

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

freginier
Solution Specialist
Solution Specialist

what's the excepted result ? 

freginier_0-1643660226746.png

 

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.