Forum Discussion
Dynamically legend
Anonymous
Follow below steps to get dynamic legends:-
1) Open the data table in Power query adn DUPLICATE it and rename the other table.
2)Remove the unwanted columns from table.
3)Add index to both tables(Original Table and Duplicate table).
4)Select and unpivot the columns that you want to display dynamically as legend.
5)After unpivoting you will get two new columns having ATTRIBUTE and VALUE
6) Save and close power query.
7)In Model view tab, create relationship between Original Table and New unpivot table on Index column.
😎 Now you can put the ATTRIBUTE column from new table(on which we have done unpivoting) in column series of clustered chart.
Hi NidhiBhusari , thank you suggestion.
But I don´t understand why I have create a index.
I will try to explain myself better:
I have two tables in my model, one table (Table1) I have all data what I need and another table (Table2) I created for select all measures in one sheet:
Table2
For example:
Vendas Reais =
VAR Logic Test =
COUNTROWS(DISTINCT(FILTER(ALLSELECTED('KPI´s'[KPI]),'KPI´s'[KPI] = " Vendas Reais"))) = 1
RETURN
IF(LogicTest, [Real_Sale],blank())The measure [Real_sale] is calculated in Table1.
When we selected in filter a measure the legend graph appear all measures (not selected in filter).
We want the legend visualizations to show only the measures that are selected.
Thank you.
- HashamNiaz5 years agoSolution Sage
Hi Anonymous !
Please try changing teh slicer type to be single select & see if that make any difference.Regards,
Hasham
- Clinical_Epi3 years agoAdvocate III
Thank you for this, worked perfectly on my own health data - where I wanted to have the Column Series switch between Episode of Care, Admission Category, Gender and I even added Ward to see how well it worked. Perfect!
Saved me hours of time running bookmarks etc!
🙂
Regards
ClinEpi