Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.