Forum Discussion

itchyeyeballs's avatar
itchyeyeballs
Impactful Individual
4 years ago
Solved

Field Parameters - Dynamic Visual Title

Hi All,   Started exploring the new field parameters which IMO is potentially the biggest upgrade to PowerBI ever. Report design can now be much more streamlined and easy to maintain. So far I...
  • itchyeyeballs's avatar
    4 years ago

    Thank you,

     

    My setup seems to be a bit different.

    When I use the field parameter wizard it creates a calculated table with 3 columns:

    xP_Param
    xP_Param Fields
    xP_Param Order

    I can use the Fields or Order columns but get the composite key error if trying to use the XP_Parm column which has the formated text name I want to use as the visual title.

    I tried adding .Key0 as in the link you provided but encountered a different error.

    Is there something I'm missing?

    Edit, I found a work around using my switch syntax but its a bit of extra work to retype the titles and not re-use them from the calculated table column

     

    xP_param1 Title = 
    SWITCH (
        SELECTEDVALUE ( xP_Param[xP_Param Order] ),
        0, "Title 1",
        1, "Title 2",
        2, "Title 3",
        3, "Title 4",
        4, "Title 5"
    )

     

    Second edit, SQLBI just posted a great article describing this issue and how to solve it - https://www.sqlbi.com/blog/marco/2022/06/11/using-selectedvalue-with-fields-parameters-in-power-bi/