cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
shikhavidyarthi
Frequent Visitor

Show/Hide Columns in Line Chart Visuals with Multiselect Slicer in Power BI #Line Chart, # Slicers,

I have a line chart with 4 columns added like below. My X -axis is operating_dates.

shikhavidyarthi_0-1675983215870.png

Now the users feel that lines seem to be crowded sometimes. Do we have an option to select two/three lines only at a time.

 

I tried creating this but I am able to select only one line at a time by using below steps.
Created a new table as slicer table:

shikhavidyarthi_1-1675983349133.png

Then create a measure as user selection:

User Selection = SELECTEDVALUE('Slicer Table'[Value])
Create a new measure:
calculation =
SWITCH(
    TRUE(),
    [User Selection] = "Act_Pkgs", sum(Data[act_pkgs]),
    [User Selection] = "EDP_Pkgs", sum(Data[edp_pkgs]),
    [User Selection] = "NOP_Pkgs", sum(Data[nop_pkgs]),
    [User Selection] = "Prev_Yr_Act_Pkgs", sum(Data[prev_yr_act_pkgs]),
    "Select any Calc"
    )
 
This way I can select only single calculation at a time. If I try to select two its displaying as blank because I am asking for two different calculation at a time.
shikhavidyarthi_2-1675983543757.png

I want two or three lines to select with color coding.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@shikhavidyarthi , Use field parameters

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
Field Parameters- Conditional Formatting
: https://amitchandak.medium.com/field-parameters-conditional-formatting-517aacc23fdf

View solution in original post

2 REPLIES 2
Belin
Frequent Visitor

Check this out

 

https://sqlskull.com/2020/10/17/show-hide-measures-in-line-chart-visuals-using-slicer-in-power-bi/

 

don't require any preview item and it's a clever solution that allow for even more customization

This was my variation for multiselect:

1)create a table called Slicer, with one column
Filtered_values

line1

line2

line3

2) create a measure like this

The_measure_as_line_to_hide_show =
IF(
    CONTAINSSTRING(ALLSELECTED(Slicer[Filtered_values]), "line1"),
    "My calculated measure",
    ""
)
3)do the same for line2 and line3
4)put a slicer in the report with the Filtered_values column
5)set the slicer to filter only that chart
amitchandak
Super User
Super User

@shikhavidyarthi , Use field parameters

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
Field Parameters- Conditional Formatting
: https://amitchandak.medium.com/field-parameters-conditional-formatting-517aacc23fdf

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors