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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

dax remove duplicates except one

Hello Everyone 

 

Help me please!! I cannot look at it anymore.

 

I have a Table like this:

Table Errorcosts

Week Number of the yearErrorplaceCumulative Errorcosts 
1Sales100 
1Production300 
2Sales330 
2Production400 
2Production400 
3Production500 
3Sales530 
4Production600 
4Production600 
4Production600 
4Sales560 
5Production700 
5Production700 
5Sales670 
6Production800 
6Sales700 
7Production900 
7 Sales800 
7 Sales800 
7 Sales800 
8Production10000 
8 Sales900 
8 Sales900 

 

Now I want to show in a line chart the cumulative costs till the present week. Thats why I made a connection through week number of the year to a date dimension table (DimDates). I then want to be able to filter this chart in Sales or Production with a simple slicer but also see the cumulative total cost. 

 

My problem is I cannot change the Table because of other important data i didnt show in the example.

 

 So I tried to creat a measure:

 

Measure = CALCULATE(SUM('Errorcosts'[Cumulative Errorcosts]),Filter(ALLSELECTED(DimDates[Week number of the year]),DimDates[Week number of the year]<=MAX(DimDates[Week number of the year])))

 

But honestly I have no clue, because I don't need to sum up the cumulative costs 

 

kind regards 

 

colin

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

Hi @Anonymous ,

 

Hi @Anonymous ,

 

Like this?

Since you already have the cumulative value, you only need to take the maximum value under each category.

v-xuding-msft_0-1606372850868.png

 

Best Regards,
Xue Ding
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

4 REPLIES 4
Anonymous
Not applicable

Bishop1895_0-1606485088191.png

proud of th final result!

Thanks for the help

v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

Hi @Anonymous ,

 

Like this?

Since you already have the cumulative value, you only need to take the maximum value under each category.

v-xuding-msft_0-1606372850868.png

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you 

 

but its not working the way I want to. Because of the sum in formula the graph in the linie chart is far to big i think.

amitchandak
Super User
Super User

@Anonymous , based on what I got

Better create Errorplace as a new dimension and create like

Measure = CALCULATE(SUM('Errorcosts'[Cumulative Errorcosts])
,Filter(ALLSELECTED(DimDates[Week number of the year]),DimDates[Week number of the year]<=MAX(DimDates[Week number of the year]))
, filter( allselected(Errorplace) , Errorplace[Errorplace] =max(Errorplace[Errorplace]))
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.