Forum Discussion

Gopal2704's avatar
Gopal2704
Frequent Visitor
3 years ago

Help in a DAX formula

Hi everyone !
I need help the below DAX formula :

CAGR % =
VAR _sumA =
    CALCULATE(SUM('Appended Data - Pivot'[SGA]), 'Appended Data - Pivot'[Attribute] = "H - 2024")
VAR _sumB =
    CALCULATE(SUM('Appended Data - Pivot'[SGA]), 'Appended Data - Pivot'[Attribute] = "SPN-29 - FY")
VAR _cagr =
    DIVIDE(_sumA, _sumB, BLANK())
VAR _Year_Min=
    CALCULATE(
        MAX('Appended Data - Pivot'[YearFormatted]),
        'Appended Data - Pivot'[Attribute] = "H - 2024"
    )

VAR _Year_Max=
    CALCULATE(
        MAX('Appended Data - Pivot'[YearFormatted]),
        'Appended Data - Pivot'[Attribute] = "SPN-29 - FY"
    )

RETURN
    IF(ISBLANK(_cagr), BLANK(), POWER(_cagr, 1/(_Year_Max - _Year_Min)) - 1)
 
In place of SUM('Appended Data - Pivot'[SGA]) i need to replace with the parameter having dax field [Acccount Level]

 

The Parameter contains the fields (DAX ) below :

Net Sales Sum = SUM('Appended Data - Pivot'[NET SALES])
BOI SUM = SUM('Appended Data - Pivot'[BOI])
SGA SUM = SUM('Appended Data - Pivot'[SGA])
 
Return Ratio sum =
IF(SUM('Appended Data - Pivot'[NET SALES]) = 0,0,
IF(SUM('Appended Data - Pivot'[SGA]) = 0,0,
-1 * DIVIDE(SUM('Appended Data - Pivot'[NET SALES]),SUM('Appended Data - Pivot'[SGA]))
)
)



 

Please help !

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Gopal2704 ,

    In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?

    Thanks for your efforts & time in advance.

     

    Best regards,
    Community Support Team_Binbin Yu