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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

How to build a Slicer for the Lines on a 'Line & Clustered Column' Chart?

 
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Anonymous ,

 

Yes, you can do it.

 

Firstly, create a table contain all lines’ name:

Lines

Line A

Line B

Line C

 

I noticed that the aggregation method of your lines is Average. Therefore, create a measure to store three lines for calling in the newly created table:

_Line A = AVERAGE('D - ISP'[Line A])

_Line B = AVERAGE('D - ISP'[Line B])

_Line C = AVERAGE('D - ISP'[Line C])

 

Drag the Lines field of the new table into the Slicer:

vhuijieymsft_0-1715324246408.png

 

Create a measure:

Measure = SWITCH(TRUE(),
SELECTEDVALUE(Lines[Lines]) = "line A", 'D - ISP'[_Line A],
SELECTEDVALUE(Lines[Lines]) = "line B", 'D - ISP'[_Line B],
SELECTEDVALUE(Lines[Lines]) = "line C", 'D - ISP'[_Line C]
)

 

Place measure on the Line y-axis of the chart, and the final page effect is as shown below:

vhuijieymsft_1-1715324246413.png

 

pbix file is attached.

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

Anonymous
Not applicable

Hi @Anonymous ,

 

Please try:

 

Modify the measure syntax as follows:

_Line A = IF(ISFILTERED('Lines'[Lines]),IF("Line A"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line A])),BLANK())

_Line B = IF(ISFILTERED('Lines'[Lines]),IF("Line B"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line B])),BLANK())

_Line C = IF(ISFILTERED('Lines'[Lines]),IF("Line C"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line C])),BLANK())

 

Other operations remain unchanged, and the page effect is as shown below:

vhuijieymsft_0-1716258712789.png
vhuijieymsft_1-1716258712792.png

vhuijieymsft_2-1716258769874.png

vhuijieymsft_3-1716258769880.png

vhuijieymsft_4-1716258778809.png

 

pbix file is attached.

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

Yes, you can do it.

 

Firstly, create a table contain all lines’ name:

Lines

Line A

Line B

Line C

 

I noticed that the aggregation method of your lines is Average. Therefore, create a measure to store three lines for calling in the newly created table:

_Line A = AVERAGE('D - ISP'[Line A])

_Line B = AVERAGE('D - ISP'[Line B])

_Line C = AVERAGE('D - ISP'[Line C])

 

Drag the Lines field of the new table into the Slicer:

vhuijieymsft_0-1715324246408.png

 

Create a measure:

Measure = SWITCH(TRUE(),
SELECTEDVALUE(Lines[Lines]) = "line A", 'D - ISP'[_Line A],
SELECTEDVALUE(Lines[Lines]) = "line B", 'D - ISP'[_Line B],
SELECTEDVALUE(Lines[Lines]) = "line C", 'D - ISP'[_Line C]
)

 

Place measure on the Line y-axis of the chart, and the final page effect is as shown below:

vhuijieymsft_1-1715324246413.png

 

pbix file is attached.

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Anonymous
Not applicable

.

Anonymous
Not applicable

Hi @Anonymous ,

 

Modify these three measures:

_Line A = IF("Line A"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line A]))

_Line B = IF("Line B"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line B]))

_Line C = IF("Line C"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line C]))

 

Put these three measures into the Line y axis, and the page effect is as follows:

vhuijieymsft_0-1715935580854.png

vhuijieymsft_1-1715935580860.png

vhuijieymsft_2-1715935595733.png

vhuijieymsft_3-1715935595743.png

 

The pbix file has been attached, if you have any other questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Anonymous
Not applicable

.

Anonymous
Not applicable

Hi @Anonymous ,

 

Please try:

 

Modify the measure syntax as follows:

_Line A = IF(ISFILTERED('Lines'[Lines]),IF("Line A"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line A])),BLANK())

_Line B = IF(ISFILTERED('Lines'[Lines]),IF("Line B"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line B])),BLANK())

_Line C = IF(ISFILTERED('Lines'[Lines]),IF("Line C"IN VALUES(Lines[Lines]),AVERAGE('D - ISP'[Line C])),BLANK())

 

Other operations remain unchanged, and the page effect is as shown below:

vhuijieymsft_0-1716258712789.png
vhuijieymsft_1-1716258712792.png

vhuijieymsft_2-1716258769874.png

vhuijieymsft_3-1716258769880.png

vhuijieymsft_4-1716258778809.png

 

pbix file is attached.

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Anonymous
Not applicable

.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.