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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Pikachu-Power
Impactful Individual
Impactful Individual

Line Charts with Filter

Hello,

 

I have the following three measures I want to show as a line chart: 

 


MeasureA = CALCULATE(SUM(Table1[Value1]), Table1[Layer] = "A")

MeasureB = CALCULATE(SUM(Table1[Value1]), Table1[Layer] = "B")

MeasureC = CALCULATE(SUM(Table1[Value1]), Table1[Layer] = "C")

 

with the possibility to filter A, B, C (or all possible combinations AB, BC, AC, ABC). How can I do that? Always have problems when i choose two values. 
1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Pikachu-Power ,

 

Like this?

v-lionel-msft_0-1605084929515.png

Or like this?(In this case, only two lines can be returned according to the user's choice.)

v-lionel-msft_1-1605085011696.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
v-lionel-msft
Community Support
Community Support

Hi @Pikachu-Power ,

 

Like this?

v-lionel-msft_0-1605084929515.png

Or like this?(In this case, only two lines can be returned according to the user's choice.)

v-lionel-msft_1-1605085011696.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-lionel-msft
Community Support
Community Support

Hi @Pikachu-Power ,

 

Like this?

v-lionel-msft_0-1604475987799.png

If not, please show the screenshot of the 'Line chart'. I want to know which fields you use in the visual and what effect you want to get.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

No I am looking for something like this:

 

https://community.powerbi.com/t5/Desktop/Line-chart-slicer/td-p/123353

 

But I want to see for example two line charts when two are selected. 

amitchandak
Super User
Super User

@Pikachu-Power , Can you take layer as a legend ? Legend should create two lines

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Ok sorry... layer in legend is possible.

 

But I use a line- and bar chart and have more measures in the value field. as far as i know we have no legend there or we cant use the legend field in case of more measures in the value field.

 

i suppose an another way to filter the line carts (and bar charts) will complicated?

mahoneypat
Microsoft Employee
Microsoft Employee

Instead of 3 measures, why not just use the Table1[Layer] column in the legend for the visual and add a slicer for that column too?

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


I already tried this... you never see two line charts if you selected two. you see one line chart with the sum of these.

nvprasad
Solution Sage
Solution Sage

Hi,

 

Please create one more measure with the if or switch function. then pass the measure in the value section of the visual.

 

Ex: If (selectedmeasure = A, A, if selectedMeasrue = B, C)

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Top Kudoed Authors