Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
IB_rewoP
Frequent Visitor

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:

DateNSWQLDVICSA
1/01/2025100908040
2/01/2025110998844
3/01/20251241129950

 

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: 

IB_rewoP_0-1736208074389.png

 

But if NSW and QLD is selected then 2 lines are displayed on the chart:

IB_rewoP_1-1736208238393.png

 

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.

 

 

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

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

danextian_0-1736218209665.png

danextian_1-1736218239914.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

Hi,

Drag State to the legend well of the Line chart.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
danextian
Super User
Super User

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

danextian_0-1736218209665.png

danextian_1-1736218239914.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.

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?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

On the contrary, I want 2 lines displayed on the chart if 2 states are selected in the State Filter slicer.  However, after I've applied your recommended solution the chart is now only displaying 1 line, see below. 

 

I have Date as the X-axis and Price as the Y-axis.  However it appears that the chart is displaying the average of both the NSW and QLD prices rather than showing each state's prices separately.  Am I missing something?

 

Underlying table:

IB_rewoP_1-1736220269089.png

 

 

Chart:

IB_rewoP_0-1736220158124.png

 

Hi,

Drag State to the legend well of the Line chart.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

You are supposed to add the states to the legend tile.

danextian_0-1736220798285.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Aha that's why.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.