Forum Discussion
Growth % DAX Command
- 1 year agoGrowth % =IF(OR([Prior Year] > 0,ISBLANK([Prior Year])),DIVIDE([Current Year] - [Prior Year],[Prior Year],1))
hi brockry1
although you can simply add 1 at the end of your current formula
It solves for the prior year of 0 equaling 100% however it sorts and shows all the addresses as the same and this isn't true: See screen shot:
- Anonymous1 year agoNot applicable
Hi brockry1 ,
I created a sample pbix file(see the attachment), please check if that is what you want.
Current Year = SUM('Table'[Sales])Prior Year = VAR _year = SELECTEDVALUE ( 'Table'[Year] ) VAR _category = SELECTEDVALUE ( 'Table'[Category] ) RETURN CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Year] = _year - 1 && 'Table'[Category] = _category ) )Growth% = IF([Prior Year]>0,(DIVIDE([Current Year]-[Prior Year],[Prior Year])),1)As shown in the screenshot above, I applied the same formula for Growth% as you did, and it returned the expected result based on the sample data. However, it seems you didn't get the expected result. Could you please provide some sample data (excluding any sensitive information) and the details FreemanZ suggested? Thank you.
You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
Best Regards