Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a sales table that I am looking to create a measure for that calculates the percentage change year-over-year. Simple enough, but for the year 2021 the percentage is way off because we have only experienced the month of January. So for 2021 I want the measure to calculate the percentage change of the running total from 2020 (January only) compared to the running total of 2021 (January only).
See picture below, instead of -97.25% I'd like the percentage to be the difference between 2021 sales and 2020 sales up until the point 2021 is up to (January in this case), so the percentages are much more comparable.
The current measure I have is:
Solved! Go to Solution.
Hi, @Anonymous
How did you create the 'Dates' table? Please check your maximum date in the 'Date'' table.
You need a calendar table to return all dates between January 1, 2018 and current max date.
Please try to create a calculated table as below:
Dates1 = CALENDAR(MIN(Example[Date]),MAX(Example[Date]))
And it isn't recommended to use function 'CALENDARAUTO()' to create a calendar table here.
It will generate a table that returns all dates between January 1, 2018 and December 31, 2021.
test result using Calendarauto:
Please check my test file for more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
How did you create the 'Dates' table? Please check your maximum date in the 'Date'' table.
You need a calendar table to return all dates between January 1, 2018 and current max date.
Please try to create a calculated table as below:
Dates1 = CALENDAR(MIN(Example[Date]),MAX(Example[Date]))
And it isn't recommended to use function 'CALENDARAUTO()' to create a calendar table here.
It will generate a table that returns all dates between January 1, 2018 and December 31, 2021.
test result using Calendarauto:
Please check my test file for more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thank you so much!
@Anonymous use parallel period DAX function
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thank you for the response. I tried that function but it did not work because I need a timeframe of up until today's date last year, not a general year, quarter or month time frame.
I've gotten the measure to this to change the measure if the selected year is the current one. Do you know how I might replace "missing calc" to sum up last year's sales up until today's date last year (so in this case, 1/22/2020)?:
Hi,
Try this measure
=calculate([Spend (Focused Accounts)],datesbetween('Dates'[Date],date(year(today())-1,1,1),edate(today(),-12)))
Hope this helps.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |