Forum Discussion
Slicer Filter to Determine which Measure Column to Display on Line Chart
I have a table with a Date and sales for each of the 4 State in columns, ie Date, NSW, VIC, QLD, SA. The table looks something like this:
| Date | NSW | QLD | VIC | SA |
| 1/01/2025 | 100 | 90 | 80 | 40 |
| 2/01/2025 | 110 | 99 | 88 | 44 |
| 3/01/2025 | 124 | 112 | 99 | 50 |
What I want to the do is create a State Filter slicer in a Power BI chart and allow the user select which state's or states' sales will be displayed on the chart.
Eg, if NSW is selected then the only NSW is displayed:
But if NSW and QLD is selected then 2 lines are displayed on the chart:
I'm hoping this is possible so to save me the trouble of having to transpose the 4 states measure columns into a state dimension column and a sales measure column.
Hi IB_rewoP
If that is your raw data then you will need to unpivot it in the query editor. Select date then Unpivot other columns
Hi,
Drag State to the legend well of the Line chart.
7 Replies
- IB_rewoPFrequent Visitor
I don't think that will cause the chart to only display one line even if I choose both NSW and QLD? I need to display 2 lines in the chart if 2 states are selected, 3 lines on the chart if 3 states are selected, etc.
- danextian
Super User
You lost me there. In your original post, you want to display two lines if both NSW and QLD are selected but now you want to display just one line?