Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Extract specific rows from table based on dynamic slicer selection

I have 3 columns Activity period, fiscal period and gross_profit having monthly data .I have activity period on slicer. Now I want to show gross profit of next two fiscal period months. I am not gett...
  • v-easonf-msft's avatar
    4 years ago

    Hi, Anonymous 

    You can try the following steps:

    1.create a saperate calculated table

     

    Slicer = DISTINCT('Table'[Fiscal period]) 

     

    2.add a new measure to replace the value of measure[M_Gross profit]

     

    M_result = 
    IF (
        DATEDIFF (
            MAX ( Slicer[Fiscal period] ),
            MAX ( 'Table'[Fiscal period] ),
            MONTH
        )
            IN { 1, 2 },
        [M_Gross profit],
        BLANK ()
    )

     

     

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