Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I have a report where there will be a date slicer, I want to sumup the amount before the start date I have choosen in the date slicer.
I'm using the below DAX to get the selected start date,
FromDate = CALCULATE ( MIN ( 'Document Date'[Date] ), ALLSELECTED ( 'Document Date'[Date] ) )
Then, I'm using the below DAX to get the Amount before the start date. This is not working.
PreviousDaySum = SUMX( FILTER( ALL(Finance),RELATED('Document Date'[Date])<[FromDate]),Finance[Local_Amount])
Solved! Go to Solution.
Hi, @Anonymous , as to your measure
PreviousDaySum =
SUMX (
FILTER ( ALL ( Finance ), RELATED ( 'Document Date'[Date] ) < [FromDate] ),
Finance[Local_Amount]
)
when the measure [FromDate] is referenced in another measure, the evaluation context already dramatically changed, i.e. row context from ALL( finance ) is transited to filter context to evaluate [FromDate].
A correction is straightforward enough,
PreviousDaySum =
VAR __before = [FromDate]
RETURN
SUMX (
FILTER ( ALL ( Finance ), RELATED ( 'Document Date'[Date] ) < __before ),
Finance[Local_Amount]
)
Yet I myselft prefer to choose "Before" type of slicer on the date column; it does the trick with a simplest measure
Total = SUM( Finance[Amount] )
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi, @Anonymous , as to your measure
PreviousDaySum =
SUMX (
FILTER ( ALL ( Finance ), RELATED ( 'Document Date'[Date] ) < [FromDate] ),
Finance[Local_Amount]
)
when the measure [FromDate] is referenced in another measure, the evaluation context already dramatically changed, i.e. row context from ALL( finance ) is transited to filter context to evaluate [FromDate].
A correction is straightforward enough,
PreviousDaySum =
VAR __before = [FromDate]
RETURN
SUMX (
FILTER ( ALL ( Finance ), RELATED ( 'Document Date'[Date] ) < __before ),
Finance[Local_Amount]
)
Yet I myselft prefer to choose "Before" type of slicer on the date column; it does the trick with a simplest measure
Total = SUM( Finance[Amount] )
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Check out the November 2025 Fabric update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!