Forum Discussion
pani_victoria
2 years agoHelper III
subtotal by lastdate
Hello!
Colleagues, I need help!
My data looks like this
There is a profitability plan for each territory.
In the matrix, I want to get a profitability plan by territory and period.
In one case, when I calculate the plan based on the minimum value, I have the result in the subtotals.
Measure 1 = minx('data', 'data'[profitability plan])
Measure 2 = SUMX ( VALUES ('data'[Territory]) , Measure 1)
In the second case, I want to calculate the result based on the maximum date, but I can’t do it. Where is the mistake?
Measure 3 =
VAR max_date = max('Date'[Date])
VAR result = CALCULATE(max('data'[profitability plan]), 'Date'[Date] = max_date)
return result
Measure 4 = SUMX ( VALUES ('data'[Territory]) , Measure 3) - ???
2 Replies
- amitchandakSuper User
pani_victoria , Try like
Measure 4 = SUMX ( SUMMARIZE ('Data','data'[Territory], 'Data'[Date], "_1" , [Measure 3]), [_1])
- pani_victoriaHelper III
Thanks, but I I got the SUM instead of the value for the last date