Forum Discussion
YoY % change not working properly..
- 2 years ago
amarinoRB ,
Try this:YoY % Change (Revenue) =
VAR LastYearRevenue = CALCULATE ( [Revenue YTD], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
VAR Chg = DIVIDE ( [Revenue YTD] - LastYearRevenue, LastYearRevenue )
RETURN
IF (
LastYearRevenue = BLANK () || Chg = -1,
BLANK (),
DIVIDE ( [Revenue YTD] - LastYearRevenue, LastYearRevenue )
)
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!
Proud To Be a Super User !!!
LinkedIn
Hi amarinoRB ,
Try adding if statment to your RETURN statement:
IF(LastYearRevenue = BLANK(), BLANK(), DIVIDE([Revenue YTD] - LastYearRevenue , LastYearRevenue))
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!! Proud To Be a Super User !!! |
Hello Anand24,
Thank you for the quick reply, but unfortunately this did not solve the issue. There currently is no data for Q4 for either of the further 2 columns, and the revenue is displaying how I would expect it to (-100%). Any other other suggestions?
- Anand242 years ago
Super User
amarinoRB ,
Try this:YoY % Change (Revenue) =
VAR LastYearRevenue = CALCULATE ( [Revenue YTD], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
VAR Chg = DIVIDE ( [Revenue YTD] - LastYearRevenue, LastYearRevenue )
RETURN
IF (
LastYearRevenue = BLANK () || Chg = -1,
BLANK (),
DIVIDE ( [Revenue YTD] - LastYearRevenue, LastYearRevenue )
)
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!
Proud To Be a Super User !!!
LinkedIn- amarinoRB2 years agoFrequent Visitor
This worked! Thank you sir. I believe the the way I calculated YTD Revenue was incorrect as I am using the Date column from that table, and not the common date table I created.
'Revenue (Financial Statements)'[Date] vs 'Date'[Date]. Could you elaborate how that would affect the output
- Ashish_Mathur2 years ago
Super User
Hi,
Share the download link of the PBI file.