123
1 TopicUnderstanding the logic of variable + filter(allexcept(
Hi! I had this challange where i needed to check for first occurrance of a value depending on reportdate I got a code that work. And this is it: FO = VAR curdate = Blad1[Reportdate] VAR cureid = Blad1[Id] VAR calc = CALCULATE( IF( cureid <> max(Blad1[Id]), 1, 0), FILTER(allexcept(Blad1, Blad1[Id]), curdate > Blad1[Reportdate])) return calc And the code works and all. But I just don't get it. I do think i understand that my variable for curdate, is evaluated against the whole column report date for each row, while the calculation is evulated. I also think i understand that allexcept in this context returns a table without the ID column, and with unique combination of values for the remaining columns which in this case is reportdate and estdeldate. In this case it is this sample data that i am working with: Id reportdate estdeldate X-123 01/05/2021 01/09/2021 Y-125 01/05/2021 01/09/2021 Z-123 01/05/2021 01/09/2021 X-123 01/07/2021 01/09/2021 A-125 01/07/2021 01/09/2021 Y-125 01/07/2021 03/09/2021 Z-123 01/07/2021 03/09/2021 X-123 01/09/2021 01/09/2021 A-125 01/09/2021 01/09/2021 Y-125 01/09/2021 03/09/2021 Z-123 01/09/2021 06/09/2021 Z-124 01/09/2021 06/09/2021 But how can the IF function, evaluate the ID when the filter functions hides that value? Please can somebody explain this? Or send me somewhere where this is explained? Thanks a lot! 😄Solved3.2KViews0likes3Comments