Forum Discussion

Applicable88's avatar
Applicable88
Impactful Individual
5 years ago
Solved

make a calculated table with distinct dates without summing up the values

Hello,

i have following source sample table (Materialtable):

Material TotalAmountDate
ZZZ200006.07.2021
ZZZ200006.07.2021
ZZZ200006.07.2021
ZZZ200006.07.2021
ZZZ200007.07.2021
ZZZ200008.07.2021
ZZZ200009.07.2021
ZZZ200010.07.2021

 

As you can see the total amount is always the same value. What also important to note is that in the date column only the 06.07.2021 date is existing 4 times. 

So I made a calculated table where I summarized it to get only distinct dates:

 
Material TotalAmountDate
ZZZ800006.07.2021
ZZZ200007.07.2021
ZZZ200008.07.2021
ZZZ200009.07.2021
ZZZ200010.07.2021

My initial intention was to calculate a cumulatie calculation, so I need a filtered table with distinct dates. But the total amount for 06.07 is wrong, it should also be 2000. In reality there are few more columns, and to calculate cumulative substracion I need the same Total Amount in every row for that material.

The normal bahaviour of DAX after grouping with summarize was to sum up the total amount of the 4 same date. 

How do I get it distinct? How do I need to write the summarize function like?

 

Thank you very much in advance.

Best

1 Reply

  • Applicable88 , Take amount also in the group by

    example new Table

    Summarize(Table,[Material],[TotalAmount],[Date])