Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, I want to create a slicer with all the column header names, and when I select a column header name in the slicer, the visual/graph legend must change to that column values.
For example, let's take the below data which has column headers as Sales, Cost, Income, Region, and Year.
So, I want to create a slicer with all the header names (Sales, Cost, Income, Region, Year), and when I select a header name the legend needs to change to that header. For example, if I select 'Sales' in the slicer I need to get the below graph and the same way for 'Income, Region, Cost, Year' when I select 'Income, Region, Cost, Year' respectively in the slicer. I tried looking for this solution, but I couldn't find it anywhere. Can someone please help me with this?
Solved! Go to Solution.
Yes,that is obvious.
Tables would not be related.
You need to do that in one table only.
That is why I said that I am not sure about legend.
Regards,
Sanket Bhagwat
I found this youtube video helpful. Please find it here https://www.youtube.com/watch?v=8e8a3o1w51M&t=444s
I found this youtube video helpful. Please find it here https://www.youtube.com/watch?v=8e8a3o1w51M&t=444s
Hi @Yashbaby .
I am not sure about legend, but you can achieve your desired result using unpivot.
However, the output screenshot you provided doesn't require any other feature.
It is a simple bar visual with Cost on Axis,Sales on Legend and Income on values.
I can help you with having column header names on the slicer.
Regards,
Sanket Bhagwat
Please confirm once what exact utput you need.
And if you want to have a slicer with column header names then follow the below steps.
1)Home->Transform Data.
2)Right click on column headers which you want in your slicer->Go to Transform->Unpivot Columns->Choose Unpivot Columns.
3)You will get 2 columns viz. Attribute and Value.
4)Home->Close and Apply.
5)Go to your report and drag a slicer onto your report page.
6)Add the 'attribute' field into the slicer.
7)Drag a bar and add value field into it.
You will get the output.
Do let me know if that works.
If this post helps, then please mark it as 'Accept as Solution' so that others could find it easily.
Hi @SanketBhagwat,
Thank you for the answer. I duplicated the table and unpivoted it as you suggested for getting the slicer with header names, but both these tables are not connected. So, when I select the attribute filter the legend doesn't change. For example in the below figure, when I select 'Income', or 'Cost', or any other filter, the value doesn't change. What I need is for the legend to change to 'Income' when I select 'Income' in the slicer and to 'Cost' when I select the 'Cost'. Hope my question is clear.
Yes,that is obvious.
Tables would not be related.
You need to do that in one table only.
That is why I said that I am not sure about legend.
Regards,
Sanket Bhagwat
you need unpivot your data firstly
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
36 | |
33 | |
18 | |
18 |