Forum Discussion
Help using Earlier in New Measure
Simply, is there any suggestion how can I use EARLIER funciton while creating new measure , it works fine creating column but, in measure I could not have any way ..
A simple demo to show how apply EARLIER in a measure.
RunningTotal Measure = CALCULATE( SUM( Table1[amount] ), FILTER( ALL(Table1) , SUMX( FILTER( Table1, EARLIER( Table1[date] ) <= Table1[date] ), Table1[amount] ) ) )
Due to low definition of the snapshots in your original post, I can't get what is the error message. If possible, upload your pbix with sample data, it can help to make your question more clear.
- POB7 years agoFrequent Visitor
The sample code provided works as advertised and was exactly what I needed, but I hate to use something I don't understand and this is in that category.
My understanding of the FILTER function is that the second parameter must be a Boolean expression. When I look at the top level FILTER function in the sample code, it uses SUMX as it's filtering expression, which I think would evaluate to a numerical result rather than a Boolean one. What am I missing?
I have looked at lot of other FILTER examples and I have yet to find something else like this. Can you shed some light on how and why this works?