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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello PowerBi Community,
I'm building a report where I need a type of dynamic DATESBETWEEN,
The report is built from two different sources : 1 and 2, I'm looking for a way to compare data from source 1 at a specific date with data from source 2 at the same date (without creating a date table if possible),
This is an accounting report, so dates are related to the fiscal year : starting 1st July each year, and to a closing date (every month);
So the dates I would be needing would be : starting date 1st July of the current fiscal year, ending date last day of previous month
This is the calculate I came up with for now, but it doesn't seem to be working well for the ending date, and I wasn't able to make a dynamic formula for the starting date either :
What would be the best way to make a dynamic datesbetween ?
Thank you very much,
Solved! Go to Solution.
@Anonymous , why don't you use datesytd
example
YTD QTY forced=
var _max = eomonth(today(),-1)
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESYTD('Date'[Date], "6/30")), blank())
//or
//calculate(Sum('order'[Qty]),DATESYTD('Date'[Date], "6/30"),filter('Date','Date'[Date]<=_max))
//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date], "6/30"),filter('Date','Date'[Date]<=_max))
comments show alternate option. year end at 6/30
@Anonymous , why don't you use datesytd
example
YTD QTY forced=
var _max = eomonth(today(),-1)
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESYTD('Date'[Date], "6/30")), blank())
//or
//calculate(Sum('order'[Qty]),DATESYTD('Date'[Date], "6/30"),filter('Date','Date'[Date]<=_max))
//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date], "6/30"),filter('Date','Date'[Date]<=_max))
comments show alternate option. year end at 6/30
Thank you very much ! It worked !
Check out the November 2025 Power BI 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!