Forum Discussion
Calculating YOY Change for Measure
Hi jmorela1
Reviewing your details, the reason ROAS YOY is not displayed for April is because the prior year had a zero baseline, not due to any DAX or Power BI issue. In April 2022, Spend was $6,897 and Revenue was $0, resulting in a ROAS of 0. For April 2023, Spend was $608 and Revenue was $131,968, giving a ROAS of about 217. The YOY % is calculated as (Current ROAS − Prior ROAS) ÷ Prior ROAS, but since the prior ROAS is 0, this leads to a division by zero, making the calculation undefined. Power BI returns BLANK in such cases to prevent misleading results, which is expected for ratio metrics like ROAS, CPM or conversion rate if the previous period had zero revenue or spend.
Leave ROAS YOY blank when the prior year has zero revenue or ROAS and optionally add a note or tooltip explaining this. If you still need a workaround, I suggest using the first non-zero month, a fixed baseline or a business defined minimum denominator. Make sure these are clearly labeled as adjusted metrics since they do not show actual YOY performance.
Regards,
Microsoft Fabric Community Support Team
I had put only a limited data set in my example. I have updated the source to have more values, and the issue persists.