March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am trying to compare sales for two separate years on ytd and mtd basis. But the first month in my data is jul and not jan; so for YTD current year it sould add jul-dec and similarly for the previous year. For MTD it should compare whatever is the latest month for the current year.
I have tried using datesinperiod with firstdate and also datesytd - but its not working :
My data looks like this :
Solved! Go to Solution.
Oh my friend, that's be called evaluation context ^_^ my recommendation is forgetting about breaking down formula and start to learn DAX, you will understand it correctly with some books about DAX or some completely articles.
Hi, could you please send me the file for reference? , thanks a lot!
Hey,
Which part of this formula is actually returning the year - 2015 for pytd and 2016 for ytd?
very elegant and interesting formula though...have learnt a lot
Hi @chakrabmonoj,
Dates[Date] <= MAX(Dates[PY Date]) is for cummulative
Dates[Year]=MAX(Dates[Year])-1<< this will return 2015 in that context
Dates[Year]=MAX(Dates[Year]) << this will return 2016 in that context
but when I am just calculating separate measures, with each of these formulae, this is what I am getting :
1. Max(dates[date]) is returning 31,12,2020
2. Year(max(dates[date] is returning 2020
so I am getting a little confused as to the above two, within your formula is returning 2015 and 2106
sorry to continue to bug you - may be its very simple for you to understand, but I am really trying to get under the skin of this formula as this is going to solve a lot of issues for me going forward and I really want to understand this in detail.
If you could just take some time and break down each part of rhe formula and show&tell, what will each part return as a value.
thank you so much
Oh my friend, that's be called evaluation context ^_^ my recommendation is forgetting about breaking down formula and start to learn DAX, you will understand it correctly with some books about DAX or some completely articles.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
122 | |
89 | |
74 | |
59 | |
53 |
User | Count |
---|---|
196 | |
121 | |
108 | |
68 | |
65 |