Forum Discussion
Need help with Dax πππ»
- 5 years ago
With this model
and this measure
Previous date for Lote = VAR Lote = MAX ( 'Dim Lote'[Lote] ) VAR CalcDate = MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Fecha Comida] < MAX ( 'Table'[Fecha Comida] ) && 'Table'[Lote] = Lote ), 'Table'[Fecha Comida] ) RETURN CALCULATE ( MAX ( 'Calendar Table'[Date] ), FILTER ( ALL ( 'Calendar Table' ), 'Calendar Table'[Date] = CalcDate ) )You will get
I've attached the sample PBIX file
I suspect this is to be a calculated column. Why don't you do this where it should be done - in Power Query? PQ lets you do such things with ease, without any coding, just by using mouse clicks...
The registration is for feeding, so I need to know how much time has passed since the last feeding, example March 20 and I want to know how many days have passed since that date when the batch is the same as the one selected, the idea of ββthat formula is that it measures, since A record was added with a certain batch back and save that date and then do the same process because if I do it dynamic, that formula would only see the last date and it is not what I am looking for. In the event that the last registration is on December 20, the difference would be very large and unreal π