Forum Discussion
earlier
Hi.
I have a problem for calculate a max date in a report.
I need to calculate max date per category in the selected range of dates.
I am using the following formula:
MaxDateGroup = CALCULATE(
MAX(Siembra[DateGroup])
;FILTER(Siembra;Siembra[_Año Semana]=EARLIER(siembra[_Año semana]
)
)
)
But it doesn't work
Thanks for your help.
11 Replies
- MattAllingtonCommunity Champion
Given you are using earlier, I guess this is a calculated column (or it returns an error). I would write a measure.
=CALCULATE(max(table[datecolumn]),all(table[categoryColumn]))
- kevinariasFrequent Visitor
Hi MattAllington thanks for your answer.
I tried with the suggested formula but it doesn't work
SuggestedMeasure = CALCULATE(max(Siembra[DateGroup]);all(Siembra[BedIdentifierId]))
Cause the result of this, show me maxdate of the all data
But i need the max date in the selected range, i tried with this another formula
CALCULATE( MAX(Siembra[DateGroup]);FILTER(ALL(Fecha);Fecha[_Año Semana]<=MAX(Fecha[_Año Semana])))
But this, doesn't replicate the max date for each row
The result that i expect, is the max date replicated for each row in the selected range.
This is an example of the expected goal.
-------------------------------------------------------------------------------
Thanks for your help.
Regards.
- MattAllingtonCommunity Champion
I can see you have tried hard to explain the issue, but unfortunately I don’t follow. No doubt a combination of this not being in English and me not seeing the data Model. Maybe you can work it out yourself if you understand what you need to do. The measure I shared removed the filter from the column specified. If his is not the right column, then change the column to the category needed. If you want to keep the slicer applied, then use ALLSELECTED instead. I have an article on ALL here https://exceleratorbi.com.au/the-all-function-in-dax/