Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Dynamic title for field parameter

Reporter = {
("Export Country/Territory", NAMEOF('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Export Country/Territory]), 0),
("Import Country/Territory", NAMEOF('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Import Country/Territory]), 1),
("Export Zone", NAMEOF('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Export Zone]), 2),
("Import Zone", NAMEOF('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Import Zone]), 3)
}
I have a field parameter contains export country, import country, import zone, export zone columns as row. and i have dragged this field parameter into slicer. now i have to create dynamic title based on selection in slicer. ex- if i select export country and i want to show selected value of export country. i tried so many approches but it's showing part of composite key. but not all columns of the composite key are included in the expression or it's dependent expression.

 

  • Anonymous 

    In Dyamic Title logic use column 'Parameter Order' from parameter table instead of the 'Parameter' column to get away with composite key issue.

     

    πŸ’Œ If this helped, a Kudos πŸ‘ or Solution mark would be great! πŸŽ‰
    Cheers,
    Kedar
    Connect on LinkedIn

6 Replies

  • Anonymous 

    In Dyamic Title logic use column 'Parameter Order' from parameter table instead of the 'Parameter' column to get away with composite key issue.

     

    πŸ’Œ If this helped, a Kudos πŸ‘ or Solution mark would be great! πŸŽ‰
    Cheers,
    Kedar
    Connect on LinkedIn

  • Hi Anonymous -you'll need to use a measure that can detect the selected field in your parameter and then display a title accordingly.

     

    Create a new measure for the title as below:using the above script and modified as 

    Dynamic Title =
    SWITCH(
    TRUE(),
    SELECTEDVALUE(Reporter[Reporter]) = "Export Country/Territory",
    "Selected Export Country: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Export Country/Territory]),
    SELECTEDVALUE(Reporter[Reporter]) = "Import Country/Territory",
    "Selected Import Country: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Import Country/Territory]),
    SELECTEDVALUE(Reporter[Reporter]) = "Export Zone",
    "Selected Export Zone: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Export Zone]),
    SELECTEDVALUE(Reporter[Reporter]) = "Import Zone",
    "Selected Import Zone: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Import Zone]),
    "Select an Option"
    )

     

     

     

     

    I hope this helps.

    • Anonymous's avatar
      Anonymous
      Not applicable

       

      • rajendraongole1's avatar
        rajendraongole1
        Super User

        try below:

         

        Dynamic Title =
        IF(
        HASONEVALUE(Reporter[Reporter]),
        IF(VALUES(Reporter[Reporter]) = "Export Country/Territory",
        "Selected Export Country: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Export Country/Territory]),
        IF(VALUES(Reporter[Reporter]) = "Import Country/Territory",
        "Selected Import Country: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Import Country/Territory]),
        IF(VALUES(Reporter[Reporter]) = "Export Zone",
        "Selected Export Zone: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Export Zone]),
        IF(VALUES(Reporter[Reporter]) = "Import Zone",
        "Selected Import Zone: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Import Zone]),
        "Select an Option"
        )))),
        "Select an Option"
        )

  • Anonymous's avatar
    Anonymous
    Not applicable

    if i select export country and i want to show selected value of export country.

    • rajendraongole1's avatar
      rajendraongole1
      Super User

      Hi Anonymous - can you share pbix file by removing sensitive data, 

       

      Updated this measure try this one. still issue exist please share sample 

      Dynamic Title =
      VAR SelectedParameter = SELECTEDVALUE(Reporter[Reporter])

      RETURN
      SWITCH(
      TRUE(),
      SelectedParameter = "Export Country/Territory",
      "Selected Export Country: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Export Country/Territory]),
      SelectedParameter = "Import Country/Territory",
      "Selected Import Country: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Import Country/Territory]),
      SelectedParameter = "Export Zone",
      "Selected Export Zone: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Export Zone]),
      SelectedParameter = "Import Zone",
      "Selected Import Zone: " & SELECTEDVALUE('DMT_GTA W_DMT_GTA_V_GTA_FCST_TON'[Import Zone]),
      "Select an Option"
      )