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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Bishop1895
Frequent Visitor

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 @Bishop1895 ,

 

Hi @Bishop1895 ,

 

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
Bishop1895
Frequent Visitor

Bishop1895_0-1606485088191.png

proud of th final result!

Thanks for the help

v-xuding-msft
Community Support
Community Support

Hi @Bishop1895 ,

 

Hi @Bishop1895 ,

 

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.
Bishop1895
Frequent Visitor

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

@Bishop1895 , 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]))
)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.