Forum Discussion
meetgandhi100
6 years agoFrequent Visitor
Workaround for EARLIER function in DIrect Query Mode
Hello, I am new to Power BI and I want to use a subsititute of EARLIER function in power BI in DIrect Query Mode for the following measure =CALCULATE(Max(SalesTable[Sales]), FILTER(SalesTable...
- 6 years ago
meetgandhi100 , Try a measure like
CALCULATE(Max(SalesTable[Sales]), FILTER(allselected(SalesTable), SalesTable[SalesID] = max(SalesTable[SalesID]) && SalesTable[Date] < max(SalesTable[Date]))
amitchandak
6 years agoSuper User
meetgandhi100 , Try a measure like
CALCULATE(Max(SalesTable[Sales]), FILTER(allselected(SalesTable), SalesTable[SalesID] = max(SalesTable[SalesID]) && SalesTable[Date] < max(SalesTable[Date]))meetgandhi100
6 years agoFrequent Visitor
Thanks. It instantly worked.
Regarding the understanding of the concept, as Earlier function uses the current row context and compares with other rows , how is Max function replicating this behaviour in this formula?