Forum Discussion

tomas12344's avatar
tomas12344
Helper III
4 years ago
Solved

Dynamic text values base on slicer

HI All

 

I need to create some helper/parametric table. This table should be used as header in matrix visual.

Currently, i have created a table, which i can use as matrix header, but the table is "static", and i need that some values contains text based on some slicers.

the actual table looks like 

Table_1=
{
("1","Actual Forecast"),
("2", "Actual Budget"),
("3", "Forecast previous year"),
("4","Forecast before 2 years")

}
I have a slicer, were the user can select the year(actual) and from this are calculated values for Actual year-1, Actual year-2,...
these values, and other values, are calcualted as measures from other values in table (this could not be calculated in M query, becuase some these values in the table are also calculated base on some filter, slicers,... set by the user).

The question is, how to create the helper/parametrical table, so that some text values contains values base on the slicer selection.  For example, when actual year is selecte 2021 instead of "Forecast previous year" I want to have text "Forecast Year 2020", and "Forecast before 2 years" sould be "Forecast Year 2019".
Wanted to use SELECTEDVALUE, but this not work in table constructor.

Thank you

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi tomas12344 ,

     

    You could consider to create four measures for "Actual Forecast", "Actual Budget", "Forecast previous year" and "Forecast before 2 years".

    Then create new measure like below:

    measure =
    SWITCH (
        SELECTEDVALUE ( Table_1[column] ),
        1, [Actual Forecast],
        2, [Actual Budget],
        3, [Forecast previous year],
        4, [Forecast before 2 years]
    )
    

     

    Best Regards,

    Jay

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi tomas12344 ,

     

    You could consider to create four measures for "Actual Forecast", "Actual Budget", "Forecast previous year" and "Forecast before 2 years".

    Then create new measure like below:

    measure =
    SWITCH (
        SELECTEDVALUE ( Table_1[column] ),
        1, [Actual Forecast],
        2, [Actual Budget],
        3, [Forecast previous year],
        4, [Forecast before 2 years]
    )
    

     

    Best Regards,

    Jay