Forum Discussion

anjanikumar's avatar
anjanikumar
Icon for Helper III rankHelper III
4 years ago
Solved

Dynamically how to write this Measure !!

Measure !!   VPY = CALCULATE(BUF_DATAMART_V[AMOUNT_USD_ACTUAL],BUF_DATAMART_V[CURRENT_YEAR]=YEAR(TODAY())-2)-CALCULATE(BUF_DATAMART_V[AMOUNT_USD_ACTUAL],BUF_DATAMART_V[CURRENT_YEAR]=YEAR(TODAY())-3...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, anjanikumar ;

    You could create a what-if table ,then create a measure.

    1.create a what-if table

    Parameter = GENERATESERIES(0, 10, 1)

    2.create a measure .

    VPY = 
    CALCULATE (
        [MOUNT_USD_ACTUAL1],
       FILTER('Table', 'Table'[CURRENT_YEAR]
            = YEAR ( TODAY () ) - [Parameter Value]))-
    CALCULATE (
        [MOUNT_USD_ACTUAL1],
       FILTER('Table', 'Table'[CURRENT_YEAR]
            = YEAR ( TODAY () ) - [Parameter Value]-1))

     The final output is shown below:

     


    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.