Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
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]))
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.
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/
Hi @MattAllington,
Let me to explain myself better.
I currently have categories with different dates over time. The need is that based on the selected time range, calculate the maximum date per category.
This is the new range with the new expected result
Thanks.
Regards.
OK, so try my suggestion from before
=CALCULATE(max(table[datecolumn]),allselected(table[categoryColumn]))
This should work as either Measure or Column
Max Date Per Category = CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Category] ) )
Good Luck!
Post some sample data in format that can be easily copied into PBI.
Make sure to include all columns/tables involved and all date columns...
Which Date Column is used to relate to your Calendar/Date table?
And which Date do you use in the Slicer?
Hi.
Here is the link for download the pbix file
Regards.
good point Sean - brain freeze.
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |