Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all, I am using two measures that calculate revenue as of today. I have one for the current year and one for the prior year. These measures allow me to compare the reservation amounts as of today vs today last year.
I am trying to find the year over year difference between the two, but I can't just subract them since the numbers are attached to the unique dates. Could anyone help with this? Thank you so much. Here are my measures:
Solved! Go to Solution.
@abeirne , best in such case to use date table
YTD Today =
var _min = eomonth(today(),-1*month(today()))+1
var _max = today()
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
LYTD Today =
var _today = TODAY()
var _max = date(year(_today)-1, month(_today), day(_today))
var _min = eomonth(_max,-1*month(_max))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Thank you! Also what i did was just make both of my measures into variables and returned both of them so that they are in one measure, then I was able to compare. Thanks!
@abeirne , best in such case to use date table
YTD Today =
var _min = eomonth(today(),-1*month(today()))+1
var _max = today()
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
LYTD Today =
var _today = TODAY()
var _max = date(year(_today)-1, month(_today), day(_today))
var _min = eomonth(_max,-1*month(_max))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
8 | |
6 |