Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
YOY quick measure in Power BI results incorrect calculation when previous year data is negative or vice versa. Following quick measure formula results a negative 217% YOY where previous year value is minus 463 and current year value is plus 541.
Solved! Go to Solution.
Hi,
Your formula would be:
YTD_Total Sales Gross YoY% =
VAR __PREV_YEAR =
CALCULATE(
SUM('Append1'[YTD_Total Sales Gross]),
DATEADD('Date_Key'[Date], -1, YEAR)
)
RETURN
DIVIDE(SUM('Append1'[YTD_Total Sales Gross]) - __PREV_YEAR, ABS(__PREV_YEAR)
Notice the ABS wrapped around the Denominator in the Divide statement.
Please mark as solution if this helps you. Kubos are much appreciated.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Hi,
Your formula would be:
YTD_Total Sales Gross YoY% =
VAR __PREV_YEAR =
CALCULATE(
SUM('Append1'[YTD_Total Sales Gross]),
DATEADD('Date_Key'[Date], -1, YEAR)
)
RETURN
DIVIDE(SUM('Append1'[YTD_Total Sales Gross]) - __PREV_YEAR, ABS(__PREV_YEAR)
Notice the ABS wrapped around the Denominator in the Divide statement.
Please mark as solution if this helps you. Kubos are much appreciated.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Thank you Steve - you are indeed "Resolver" 🙂
Cheers,
Petek
Why would you want to do an ABS conversion? What is your definition of YoY performance when the previous year was -20 and this year is 30 ? IMHO you should BLANK() out results where the prior year was negative. Unless both are negative, for example prior year -20 and this year -10 ? Nah, still doesn't make sense.
Thank you for your response. I hear you, but in our world none of the YOY or growth numbers alone make sense unless we present them with context and a narrative. In this scenario, pre-built quick measure is giving a negative growth although it is positive.
w/ABS | w/out ABS | |||
Current | Previous | Increase (Decrease) | % Growth (YOY) | % Growth (YOY) |
10 | 5 | 5 | 100% | 100% |
5 | 10 | -5 | -50% | -50% |
10 | -5 | 15 | 300% | -300% |
-10 | 5 | -15 | -300% | -300% |
-5 | -10 | 5 | 50% | -50% |
-10 | -5 | -5 | -100% | 100% |
In the spirit of providing solutions, how do you suggest the quick measure to be edited so it returns BLANK(). Your response might help others whose scenario fits the definition.
Thank you,
Petek
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
17 | |
10 | |
10 | |
8 | |
6 |
User | Count |
---|---|
20 | |
18 | |
16 | |
13 | |
10 |