Forum Discussion

PowerBIAnalyst7's avatar
PowerBIAnalyst7
Regular Visitor
2 years ago
Solved

Dynamic title headers are not working as expected and table visual is unfiltering data

Hi There, please help me solve the scenario i am trying to achieve as i got this requirement.

 

I have 4 table visuals containing sales values by category, subcategory, model and product.

and i have used DAX measures for dynamic header titles to display the selected values for each table from previous selection. 

 

1. selectedcategoryheader = "Selected category: " & if(ISFILTERED('Product'[Category]),SELECTEDVALUE('Product'[Category]),"all")

 

2.

selectedsubcategoryheader =
var _selectedcategory = "Selected category: " & if(ISFILTERED('Product'[category]),SELECTEDVALUE('Product'[category]),"all")
var _selectedsubcategory = "Selected subcategory: " & if(ISFILTERED('Product'[Subcategory]),SELECTEDVALUE('Product'[Subcategory]),"all")
return _selectedcategory & " and " & _selectedsubcategory

 

3.

selectedModelheader =
var _selectedsubcategory = "Selected subcategory: " & if(ISFILTERED('Product'[Subcategory]),SELECTEDVALUE('Product'[Subcategory]),"all")
var _selectedmodel = "Selected Model: " & if(ISFILTERED('Product'[Model]),SELECTEDVALUE('Product'[Model]),"all")
return _selectedsubcategory &" and " & _selectedmodel

 

Result steps:

1. when i selected 1st table values, 2nd table dispalyed the filtered data and displayed the appropriate 1st table value as header dynamically

 

2. when 2nd table, the  filtered data is reset and all values shows and header is not displaying the previous value and i understand its because of "SELECTEDVALUE" measure as 1st table is un-selecting.

 

3. the above steps are repetitive to both 3rd and 4th table.

4. I cross checked the functionality with/without "edit interactions" and its same.

 

Expected result:

The next tables in line should show filtered data and the title headers should vary accordingly.

 

I am unable to attach the power bi file used to replicate the scenario as i cannot find insert option.

 

Appreicate for the help in advance !

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi PowerBIAnalyst7 ,

    Regarding your problem, your solution is feasible, you just need to use 'Ctrl' key + left click to select.

     

    Best Regards,
    Wenbin Zhou

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi PowerBIAnalyst7 ,

    Regarding your problem, your solution is feasible, you just need to use 'Ctrl' key + left click to select.

     

    Best Regards,
    Wenbin Zhou

    • PowerBIAnalyst7's avatar
      PowerBIAnalyst7
      Regular Visitor

      Hi Anonymous - Thank you, I agree with your solution and appreciate your response.

       

      I have provided "Ctrl" key solution to my business however they show unwillingness to accept and insisting to suffic the requirement with just a click and not user ctrl

       

      One observation is ideally the table is unfiltering the data if the value is clicked the 2nd time and that is causing the headers to reverting to all instead of showing specific title. not sure if this is the default functionality of power bi

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi PowerBIAnalyst7 ,

        Regarding your question, are you okay with using the slicer? It remembers your previous selections.

         

        Best Regards,
        Wenbin Zhou