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
Hi All,
I have calculated the below DAX measures which is working fine
I need to find the TotalQTD for Previous Year same period. I have a date slicer which has week ending dates.
DAX what I am using for it:
But this PY QTD results are not coming correct. Kindly help.
Thanks in Advance
Solved! Go to Solution.
Hi,
Try using the SAMEPERIODLASTYEAR
The Dax might look like this.
PY QTD=Calculate([Revenue/Spend], SAMEPERIODLASTYEAR('DateDIM'[End of Week]))
Please mark it as the solution if this works.
Please find an example
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD('Date'[Date Filer]))
Last year Qtr Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER(dateadd('Date'[Date Filer],-12,MONTH)))) // Use end of qtr only if required
PY QTD=Calculate([Revenue/Spend], (DATESQTD(dateadd('DateDIM'[End of Week],-1,YEAR)))
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
Hey Amit, Thanks for your help.
No luck witk this DAX though.
I found the solution. Below DAX is giving me correct results
Hi,
Try using the SAMEPERIODLASTYEAR
The Dax might look like this.
PY QTD=Calculate([Revenue/Spend], SAMEPERIODLASTYEAR('DateDIM'[End of Week]))
Please mark it as the solution if this works.
Hi Vipul,
Thanks for your quick response.
This works for me.
Hi @Anonymous ,
Would you kindly mark my DAX the solution? That will help others quickly get to it. Thank you.
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 |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |