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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
khadijabl2000
Frequent Visitor

dynamic reference line

How to set a reference line that automatically adjusts to the dropdown slicer in Power BI. If you select an item from the dropdown list, the line takes a specific value. For example: in my dropdown i have cities and the max of values changes if we change the city we look for if the item is 'Tokyo', the line value becomes 4, and if the item is 'Paris', the line value becomes 3. and on my X-axis i have date and on my Y-axis is value

khadijabl2000_0-1774569267130.png

 

1 ACCEPTED SOLUTION

Hi @khadijabl2000 ,
Thanks for sharing the screenshot that really helps. The reason your reference line is still showing 1M even after selecting New York is likely because the measure behind the line is removing the filter context, usually due to the use of ALL or a similar function. When ALL is used it ignores slicers like City so the line does not respond to your selection. To fix this you will need to update the measure so it respects the filter context.
For example Line Value = AVERAGE Sales Amount or using CALCULATE without removing filters. Also make sure you have applied the measure using the fx button in the Analytics pane instead of entering a static value. Once updated the reference line should dynamically adjust when you select different cities like New York or Boston. 

Please find the attached .pbix file for your reference.

Thank you.

View solution in original post

8 REPLIES 8
danextian
Super User
Super User

Hi @khadijabl2000 

You can use a column and line combo chart and use the line as a reference (use a conditional measure for the line). Or you can add a constant line and click fx to select the measure. In the image below though, the value is manually inputted.

danextian_0-1774566462426.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.

hi @danextian Thank you for your time. Eventually it worked.

Best regards, 

Khadija 

i did that but it doesn't work maybe i did something wrong 

khadijabl2000_0-1774571485373.pngkhadijabl2000_1-1774571489305.pngkhadijabl2000_2-1774571493783.png

 

What doesn't work? I can see that the reference line is at 1M which is true because you haven't selected New York.





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.

here you can see that. when i select new york the line still in 1M. my bad I didn't send this screen earlier.

khadijabl2000_0-1774598318369.png

 

Hi @khadijabl2000 ,
Thanks for sharing the screenshot that really helps. The reason your reference line is still showing 1M even after selecting New York is likely because the measure behind the line is removing the filter context, usually due to the use of ALL or a similar function. When ALL is used it ignores slicers like City so the line does not respond to your selection. To fix this you will need to update the measure so it respects the filter context.
For example Line Value = AVERAGE Sales Amount or using CALCULATE without removing filters. Also make sure you have applied the measure using the fx button in the Analytics pane instead of entering a static value. Once updated the reference line should dynamically adjust when you select different cities like New York or Boston. 

Please find the attached .pbix file for your reference.

Thank you.

Hi @v-sshirivolu

Thank you very much for your help. I used ALLSELECTED and it did work.

Best regards, 

Khadija

 

Hi @khadijabl2000 ,

Glad to hear that using ALLSELECTED worked for your scenario.
Thanks for confirming. Feel free to reach out if you need any further assistance.
Best regards,
Sreeteja.
Community Support Team.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.