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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tspoon
Frequent Visitor

Work around with line chart and slicer

Dear all,

 

I want to create a slicer to filter a line chat viz with drop down selector to this line chart:

tspoon_1-1721103699021.png

NoActivityWeekPlanActual
1Demolition00.00%0.00%
2Demolition10.00%0.00%
3Demolition20.22%0.31%
4Demolition30.49%0.62%
5Demolition40.60%0.78%
6Demolition51.42%1.84%
7Demolition61.63%2.63%
8Demolition73.06%3.71%
9Demolition84.92%6.95%
10Demolition96.29%9.58%

 

 

Problem is if I choose, for example, Week 4, it will show only the Week 4 data in line chart with dots of plan and actual:

tspoon_0-1721103300213.png

Is it possible if I choose Week 4 from slicer then the line chart show data from Week 1 to Week 4 without holding Control for multiple selection? So, when I select Week 4, it is actually selecting data of Week 1 to Week 4:

tspoon_2-1721103713233.png

Many thanks in advance.

 

1 ACCEPTED SOLUTION

Ok @tspoon 
Then, you need to add a slicer to the table that has no relationship with the table of the line chart.

Ritaf1983_0-1721113178112.png

And create flag measure :

Flag =
if(SELECTEDVALUE('Table'[Category]) <= max('Slicer'[Category]),1,0)
This measure can be used as a filter for the line
Ritaf1983_1-1721113293584.png

Result:

Ritaf1983_2-1721113332926.pngRitaf1983_3-1721113357935.png

Pbix is attached

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

 

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached files.

Hope this helps.

 


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

Dear @Ritaf1983 ,

 

I am aware using range slicer is easier, but it take lots of space in my page. It's quite full of visualization already, that's why i insist  to user drop down slicer.

 

Thank's for your suggestion. But i consider it as an alternative for now. Hoping there is solution for my case.

Ok @tspoon 
Then, you need to add a slicer to the table that has no relationship with the table of the line chart.

Ritaf1983_0-1721113178112.png

And create flag measure :

Flag =
if(SELECTEDVALUE('Table'[Category]) <= max('Slicer'[Category]),1,0)
This measure can be used as a filter for the line
Ritaf1983_1-1721113293584.png

Result:

Ritaf1983_2-1721113332926.pngRitaf1983_3-1721113357935.png

Pbix is attached

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

 

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you so much for your help dear @Ritaf1983 !

Dear @Ritaf1983 ,

 

Is it possible to keep the scale (x-axis) to the max value for any value that we select in the slicer? 

tspoon_1-1721118542390.png

For example, if we select 6 in the slicer, the line will show value 1-5 but the x-axis still showing the max value (9)


  

Hi @tspoon 

Yes, you can create a measure :

Max_X = CALCULATE(MAXX('Table','Table'[Category]),all('Table'[Category]))
And use it for modifying the max X-axis value:
Ritaf1983_0-1721119511652.png

Result:

Ritaf1983_1-1721119579125.png

The updated pbix Is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Sorry, if i may, need your help again, dear @Ritaf1983 

 

I modified the table of your "slicer until.pbix", the "Flag" and Max-X measurement :
CategoryPlanActual

10%0.00%
215%14.00%
330%27.00%
450%57.00%
575%68.00%
6100%100.00%
Flag =  IF(SELECTEDVALUE('Table'[Category]) <= max('Slicer'[Category]),1,0)

Max_X = CALCULATE(MAXX('Table','Table'[Category]),all('Table'[Category]))

 

The result worked fine.

 

But, when I did try to do the same thing with y-axis to make it always at 100%, but it seems not working:

Max_Y = CALCULATE(MAXX('Table','Table'[Plan]),all('Table'[Plan]))

 

Do you have any suggestion?

ps: how do we attach the pbix file to this message?



Hi @tspoon 
You can create the measures :

Act = sum('Table'[Actual])
Plan_% = sum('Table'[Plan])
Max_X = CALCULATE(MAXX('Table','Table'[Category]),all('Table'[Category]))
Max_Y = CALCULATE(MAXX(SUMMARIZE('Table','Table'[Category],"plan",[Plan_%]),[plan]),all('Table'[Category]))
Result :
Ritaf1983_0-1721393409742.png

The updated pbix is attached.

According to the attached files, the option is available for superusers only, if you need to share a file, you can upload it to some public drive and share via hyperlink.

more information about this here :
How to Get Your Question Answered Quickly  

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

One last thing...
Is it possible to make the y-axis shows fix lines (from the first to the last value) but the x-axis "move" according the slicer?

Ritaf1983
Super User
Super User

Hi @tspoon 
The easiest way is to use a range slicer instead of a list...

Ritaf1983_0-1721104683760.png

The pbix is attached

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

 

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors