Forum Discussion

reemadsouza's avatar
reemadsouza
Frequent Visitor
1 year ago
Solved

Need help with a calculated column

I have this matrix created and i want to add a column which is calculating the MTD vsalues based of this condition belown ie if row is 202, then take value in row 201 and divide by value in row 75, it calculate dynamically as filters changes for compoany geo, period all from the same table

 

 

 

  • Hello reemadsouza 

     

    You can try this measure

    MTD Ratio =

    VAR Row201_MTD =

        CALCULATE (

            [MTD Measure],

            'Data'[MetricID] = 201

        )

    VAR Row75_MTD =

        CALCULATE (

            [MTD Measure],

            'Data'[MetricID] = 75

        )

    VAR CurrentMetric =

        SELECTEDVALUE ( 'Data'[MetricID] )

    RETURN

        IF (

            CurrentMetric = 202,

            DIVIDE ( Row201_MTD, Row75_MTD )

        )

     

     

    Thanks,
     Pankaj Namekar | LinkedIn

    If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

1 Reply

  • Hello reemadsouza 

     

    You can try this measure

    MTD Ratio =

    VAR Row201_MTD =

        CALCULATE (

            [MTD Measure],

            'Data'[MetricID] = 201

        )

    VAR Row75_MTD =

        CALCULATE (

            [MTD Measure],

            'Data'[MetricID] = 75

        )

    VAR CurrentMetric =

        SELECTEDVALUE ( 'Data'[MetricID] )

    RETURN

        IF (

            CurrentMetric = 202,

            DIVIDE ( Row201_MTD, Row75_MTD )

        )

     

     

    Thanks,
     Pankaj Namekar | LinkedIn

    If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.