Forum Discussion

JuhoP's avatar
JuhoP
New Member
8 years ago
Solved

Calculate dynamic measure based on slicer selection

Hi Everyone,   I am total newbie for Power BI, just couple of days hands on. I have a problem that I have not been able to solve till now and I was wondering if you could help me?   I have used a...
  • v-ljerr-msft's avatar
    8 years ago

    Hi JuhoP,

     

    Could you try the formula below to see if it works? :smileyhappy:

    Metrics1 =
    VAR s = [Selected]
    RETURN
        ABS (
            CALCULATE (
                MAX ( 'FactTable'[Value] );
                'DimensionTable'[Column] = s;
                LASTDATE ( 'Dimension Date'[Calendar_Date] )
            )
                / (
                    CALCULATE (
                        MIN ( 'FactTable'[Value] );
                        'DimensionTable'[Column] = s;
                        ALLSELECTED ( 'Dimension Date'[Calendar_Date] )
                    )
                )
                - 1
        )
    

     

    Regards