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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Vinod_V_12
Frequent Visitor

Optimizing the Growth calculation DAX

Hi Team,

 

Please could anyone help me in simplying this DAX. This query is consuming a lot of memory in SAP HANA DB and the visuals are not getting loaded.

 

 YOY Growth % =
VAR b =
    MAX ( 'Table'[Fiscal Qtr Ref] )
VAR Nr =
    SUMX (
        FILTER ( 'Table', 'Table'[Field1] = "ABC" || 'Table'[Field1] = "XYZ" ),
        'Table'[Current Year Sales]
    )
VAR DR =
    IF (
        b <> 0,
        CALCULATE (
            SUM ( 'Table'[Current Year Sales] ),
            FILTER (
                ALL ( 'Table'[Fiscal Qtr Ref], 'Table'[Fiscal Qtr Year] ),
                'Table'[Fiscal Qtr Ref] = b - 4
            )
        ),
        CALCULATE (
            SUM ( 'Table'[Prior Year Sales] ),
            FILTER (
                ALL ( 'Table'[Fiscal Qtr Ref], 'Table'[Fiscal Qtr Year] ),
                'Table'[Fiscal Qtr Ref] = b - 4
            )
        )
    )
RETURN
    DIVIDE ( ( Nr - DR ), DR, 0 )
1 ACCEPTED SOLUTION
Vinod_V_12
Frequent Visitor

I have created two Variables for the script in VAR DR and used the IF condition after the RETURN clause to pull it.

 

This worked.

View solution in original post

3 REPLIES 3
Vinod_V_12
Frequent Visitor

I have created two Variables for the script in VAR DR and used the IF condition after the RETURN clause to pull it.

 

This worked.

NidhiBhusari
Helper IV
Helper IV

Hey @Vinod_V_12 can you explain the scenario along with it please share sample data.

Sure..

 

The visual is Matrix. Rows has 8 hierachy dimensions + Column has Fiscal Qtr Year + Values has Sales and Growth % as the fields. The data needs to be shown for 3 Fiscal year both by Quater and Month.

 

When the Growth% field is added in to the visual it breaks.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors