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

Remove duplicated rows in SUM calculation

Hello

I need to calculate a total of  a column but there are duplicate values that I need to get rid of them

the two following measures are not working.

 

Total Bookings:=CALCULATE(SUM(BP[Total Amount]),FILTER(BP,DISTINCT(BP[Unique BLI ID])))

Bookings:=SUMX(FILTER(BP,DISTINCT(BP[Unique BLI ID])),BP[Total Amount])

 

I need to compute the total amount of booking based only taking into consideration the unique vlaue of the column [Unique BLI ID]

 

please support 

please find below the link to the Excel file

 

https://laurentide0-my.sharepoint.com/:x:/g/personal/ibourega_laurentide_com/EVMldwoOdqFGpwr-_j4QGMI...

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

There are two way for you to achieve your requirement.

 

1. Remove duplicate rows in Query Editor and then apply and close to report view, create a measure with the fomrula below.

 

Measure = CALCULATE(SUM('remove duplicate rows'[Amount]))

2. Create the measure directly with Dax formula below.

 

Measure 2 =
SUMX (
    SUMMARIZE ( 'Table1', 'Table1'[ID], "amount", AVERAGE ( Table1[Amount] ) ),
    [amount]
)

Untitled.png

 

In addition, you also could refer to my test pbix.

 

Best  Regards,

Cherry

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

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.