Forum Discussion
Columns present in table visual need to be changed on the basis of KPI selection.
In the Power BI data model, we have one fact table with multiple columns and one dimension table for KPI which connected via many to one relationship. Now we have dragged KPI from dimension table into slicer and in table visual we have added all columns from the fact table. Requirement: When we select a KPI, we will see 5/6 columns from the fact table inside the table visual and for the another KPI, we will see few other columns from the fact table inside the same table visual.
Precisely we want the columns present in the table visual need to be changed dynamically based on KPI selection from slicer. Can we achieve this requirement in Power BI? IF yes, please provide the easiest possible solution.
2 Replies
- vivien57Super User
Hello saptadipa ,
If I understand correctly, you want to do something like this ?
https://www.youtube.com/watch?v=6B9ni5ekTbQ
If this helps, feel free to give me a kudo and mark my answer as the solution.
Have a nice day,
Vivien - cengizhanarslanSuper User
Yes, but not by “show/hide physical columns” in the native Table visual. In Power BI, columns in a table visual are fixed. The easiest way is to switch to measures and use a Field Parameter (or a Matrix).
Practical options:
If those “columns” are really numeric fields you can express as measures (Sum/Avg/Max etc.), create measures for each one, then:
Modeling → New parameter → Fields
Add the measures you want as “possible columns”
Put the parameter into the Table visual (Values)
Use your KPI slicer to control which measures show by returning BLANK for the ones you don’t want.
Example pattern for each “column measure”:
Show Col A = IF ( SELECTEDVALUE('KPI'[KPI]) = "KPI 1", [Col A Measure], BLANK() )Do this for Col B, Col C… then your field parameter will only “display” the ones not blank.
If you truly need to show different sets (5–6 vs other 5–6) and avoid writing many IFs, the common workaround is two table visuals (one per KPI set) and toggle them with Bookmarks + Selection pane.