Forum Discussion
adityavighne
5 years agoContinued Contributor
Max value total in table
Hi, I have table for category and sales. I want to dispaly last dat sales value and sum in table. Category Sales Date A 100 1jan B 200 1jan A ...
- 5 years ago
Hello, @adityavighne
According to your description, I created data to reproduce your scenario. The pbix file is attached at the end.
Mesa:
You can create two measures as follows.
SumSales = SUMX( SUMMARIZE( 'Table', 'Table'[Category], "Result1", CALCULATE( SUM('Table'[Sales]), FILTER( ALLEXCEPT('Table','Table'[Category]), [Date]=MAX('Table'[Date]) ) ) ), [Result1] )Latest Date = MAX('Table'[Date])Result:
Best regards
Allan
If this post helps,then consider Accepting it as the solution to help other members find it faster.
v-alq-msft
5 years agoCommunity Support
Hello, @adityavighne
According to your description, I created data to reproduce your scenario. The pbix file is attached at the end.
Mesa:
You can create two measures as follows.
SumSales =
SUMX(
SUMMARIZE(
'Table',
'Table'[Category],
"Result1",
CALCULATE(
SUM('Table'[Sales]),
FILTER(
ALLEXCEPT('Table','Table'[Category]),
[Date]=MAX('Table'[Date])
)
)
),
[Result1]
)Latest Date = MAX('Table'[Date])
Result:
Best regards
Allan
If this post helps,then consider Accepting it as the solution to help other members find it faster.