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
EHA_SD
Advocate III
Advocate III

Allow a user to turn reference lines on and off when using a logarithmic axis

I would like the user to have the ability to turn a few reference lines on and off independently of each other.

 

Using field parameters and a few DAX measures set up I nearly have a working prototype, but the issue is that if I set my false condition in the DAX to BLANK() then only one of the reference lines disappers, the other resets itself to 0. If I set the false condition to "" then both lines will disappear, but the value is getting set to something 0 like as it turns off my logarithmic axis (which doesn't allow for negative or 0 values).

 

How can I get this to work?

 

Thank-you in advance.

 

NotShowing.pngShowing.png

 

Reference Lines = {
("LOD", NAMEOF('Limits'[LOD]), 0),
("LOQ", NAMEOF('Limits'[LOQ]), 1)
}

 

 

LOD reference line =
VAR _RawSignalSelected = SELECTEDVALUE('Indicator parameter'[Indicators]) = "'Measures Table'[Raw 7-day moving average]"
VAR _SelectedRefLine = "LOD" IN ALLSELECTED('Reference Lines'[Reference Line Name]) && ISFILTERED(('Reference Lines'[Reference Line Name])) = TRUE()
VAR _LOD = CALCULATE(MAX('Limits'[LOD]))
RETURN
IF(_RawSignalSelected && _SelectedRefLine,_LOD,"")
 
 
LOQ reference line =
VAR _RawSignalSelected = SELECTEDVALUE('Indicator parameter'[Indicators]) = "'Measures Table'[Raw 7-day moving average]"
VAR _SelectedRefLine = "LOQ" IN ALLSELECTED('Reference Lines'[Reference Line Name]) && ISFILTERED(('Reference Lines'[Reference Line Name])) = TRUE()
VAR _LOQ = CALCULATE(MAX('Limits'[LOQ]))
RETURN
IF(_RawSignalSelected && _SelectedRefLine,_LOQ,"")

 

2 REPLIES 2
EHA_SD
Advocate III
Advocate III

Thank-you for the suggestion. I am already using bookmarks to switch between linear and log views, but if I have to I will resort to additional bookmarks showing/hiding the reference lines too.

christinepayton
Super User
Super User

The only way I know of to let your users toggle visual settings is with bookmark buttons. You duplicate the visual for as many settings you need them to toggle, then show/hide them with the bookmarks to display one per button with each setting. It sounds like you kind of want this to dynamically happen with what's going on in your chart, though, which this wouldn't solve for... You could potentially write a measure for the line vs using the built-in constant lines though, and have it return blank with an if-statement under your specific conditions? 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors