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
apoje
Helper II
Helper II

Duplicate values in multiple rows - calculation problem

Hi,

 

ERP returns me a sales dataset that for each item in the order returns a row in a dataset, which specifies quantity, id and the rest... however this row also contains the total order value. So whenever I have an order with multiple items I get the rows populated with multiple duplicates of order totals. And therefore the sales report is insanely distorted. 

 

I am a novice in Power Pivot and my only way to solve this would be to create a duplicate dataset, which deletes all duplicates on the basis of OrderId and from there use the order total. 

But I think the more elegant solution would be with measures, however I do not know how to write it. Can any of you help me with this? 

The sample screenshot of the data is below:  

duplicate-order-totals.jpg

 

Thanks!

Andraz

1 ACCEPTED SOLUTION
apoje
Helper II
Helper II

I guess I'm going to solve it for myself 🙂

 

MaxOrderAmount = MAX('Sharepoint-RAW-data-link'[OrderAmount.grossTotal])

GrossTotalOrderAmountD = SUMX(DISTINCT('Sharepoint-RAW-data-link'[Order.id]),[MaxOrderAmount])

View solution in original post

1 REPLY 1
apoje
Helper II
Helper II

I guess I'm going to solve it for myself 🙂

 

MaxOrderAmount = MAX('Sharepoint-RAW-data-link'[OrderAmount.grossTotal])

GrossTotalOrderAmountD = SUMX(DISTINCT('Sharepoint-RAW-data-link'[Order.id]),[MaxOrderAmount])

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.