The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 !