Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
brockry1
Helper II
Helper II

Growth % DAX Command

I'm trying to place a conidional DAX formula to show if the prior year is 0 then show 100% growth other wise divide the current year/prior year -1.  

 

When I add the clause "If(Prior Year) isblank,1, 

if prior year>0, divide current year/prior year-1

 

this is giving me a "False" return and not showing the cell as 100%.

 

Current formula is "

Growth = IF([Prior Year]>0,

(DIVIDE([Current Year]-[Prior Year],[Prior Year])))
 
and shows this
 
brockry1_0-1733245561418.png

 

 

Need blank cell to show 100%...what am I doing wrong? 

1 ACCEPTED SOLUTION
brockry1
Helper II
Helper II

Growth % =
IF(
        OR(
            [Prior Year] > 0,
            ISBLANK([Prior Year])
        ),
 
        DIVIDE(
            [Current Year] - [Prior Year],
            [Prior Year],
            1
        )
    )
 

View solution in original post

6 REPLIES 6
brockry1
Helper II
Helper II

Growth % =
IF(
        OR(
            [Prior Year] > 0,
            ISBLANK([Prior Year])
        ),
 
        DIVIDE(
            [Current Year] - [Prior Year],
            [Prior Year],
            1
        )
    )
 

This was the formula that worked. 

Selva-Salimi
Super User
Super User

hi @brockry1 

 although you can simply add 1 at the end of your current formula

Growth = IF([Prior Year]>0(DIVIDE([Current Year]-[Prior Year],[Prior Year])),1)
 or
add +0 at the end of your prior calculation, and define the condition based on zero.
 
If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

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:

brockry1_0-1733250819350.png

 

 

Anonymous
Not 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)

vyiruanmsft_0-1733366735365.png

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

hi @brockry1 ,

 

that might be another issue. can you tell more about your data model, and the code for the two measures, [Current Year] and [Prior Year]?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.