Forum Discussion
MarcUrdang
6 years agoPost Patron
variance calculation
Please advise on how to create a variance and a variance % as per below: I have created two calculations which compute a measure for a period of time. This year to date and last year to date: 1....
- 6 years ago
amitchandak
6 years agoSuper User
MarcUrdang , try like
YTD QTY forced=
var _max = today()
return
calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),'Date'[Date]<=_max)
//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
LYTD QTY forced=
var _max = date(year(today())-1,month(today()),day(today()))
return
CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
//TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)
- MarcUrdang6 years agoPost Patron
Hi Amit .. thanks for trying to help. hope all well your side
So to clarify:
1. My calcs work fine for indiviudal fields
2. To get the difference btw the two I use yours ... is it once calc? Also why the // this is to make what follows just text?
Sorry that i'm a little confused .. can you help clarify?
tx
Marc
- MarcUrdang6 years agoPost Patron
Hi Amit .. got it to work .. .WOW WOW ... you are a legend!!!!! I get scared to think of does one ever get to be as knowledgeable as someone like you.
thank you soooo very much