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 all,
I have an issue with my DAX formula.
I want to compare to dates in a matrix using a dates filter (Quarters and Year):
I almost solved this by using the following two formulas.
First date (e.g. Q1 2017):
Min_Value = CALCULATE(SUM('Totals'[Value])|FILTER(ALL('Date'[Date])|'Date'[Date] <= MIN('Date'[Date])))
Second date (e.g. Q1 2018):
Max_Value = CALCULATE(SUM('Totals'[Value])|DATESYTD('Date'[Date]))
But with the formula for the first date I have the issue that I get the values for the beginning of the quarter but I want to have the values for the end of the quarter.
If I add 90 days to the MIN Date I get roughly what I am looking for but of course this isn't accurate:
Min_Value = CALCULATE(SUM('Totals'[Value])|FILTER(ALL('Date'[Date])|'Date'[Date] <= MIN('Date'[Date])+90))
Is there a way that I can add 3 month to the MIN date which would give me the accurate result?
Many thanks in advance.
Philip
Solved! Go to Solution.
Hi,
Not sure of what you want but try this
Min_value = CALCULATE(SUM('Totals'[Value]),DATESBETWEEN('Date'[Date],EDATE(MIN('Date'[Date]),3),EDATE(MIN('Date'[Date]),3)))
Hope this helps.
Hi,
Not sure of what you want but try this
Min_value = CALCULATE(SUM('Totals'[Value]),DATESBETWEEN('Date'[Date],EDATE(MIN('Date'[Date]),3),EDATE(MIN('Date'[Date]),3)))
Hope this helps.
Thanks a lot! That solved my problem!
You are welcome.
I’m not 100% clear what you are trying to do. The trick with these things is to have an ID column for the granularity you are trying to time shift. So if you want to time shift months, then create a unique month ID. Have a read of my article here for a more complete explanation. https://exceleratorbi.com.au/dax-time-intelligence-beginners/
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.