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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
nkpenta
Microsoft Employee
Microsoft Employee

dynamic constant line for blank value

HI,

 

Dynamic constant line is showing at 0 when the measure value is blank. how can we not show the constant line when the measure value is blank?

1 ACCEPTED SOLUTION
nkpenta
Microsoft Employee
Microsoft Employee

Added if condition on the measure as below to fix the issue. it works now.
if(measure<>blank(),measure,"Text")

View solution in original post

6 REPLIES 6
nkpenta
Microsoft Employee
Microsoft Employee

Added if condition on the measure as below to fix the issue. it works now.
if(measure<>blank(),measure,"Text")

Anonymous
Not applicable

FYI - when attempting to use multiple constant lines on the same visual, this temp solution needs a little bit more to work.  

my requirement is to display between 1 and 3 different constant "benchmark" values base on 3 different slicer parameters (show value 1, show value 2, show value 3.)

to get it to work, I am using 3 constant lines with three different measures. 
Each Measure has the ability to return the constant value (calculated in a Variable wihtin DAX to ensure it is a constant) or a blank depending on other values in the dataset.   

Using the additional logic to replace the blank with a "Text" works to hide the constant line BUT ONLY WHEN THE FIRST constant line is showing on the visual.  if the first constant line is not showing (aka, the value is set to "Text" for all the constant lines,) then all of my regular charted values look very strange and get plotted at the same y intercept regardless of what their values really are.

To Workaround, setup the first constant line named "Placeholder"as a constant which intercepts at 0 (no measure needed... just set the value to 0).  make the line transparent so it can't be seen.  add your other constant lines as needed but make them measure driven so they return the needed constant value or "Text".  

Once that placeholder constant line is established, I then have the ability to independantly turn on or off the constant lines via the slicers.

The Placeholder solution is fantastic. It mitigates this Constant Line null to zero bug.

 

Just want to highlight that the solution requires putting the Placeholder = 0 constant line first before the other real constant lines.

Exactly! I was finally able to workaround the bugs in my particular scenario with this solution. As there is no option to adjust the order of the ref lines it means you need to DELETE any lines you have, then start with the Placeholder = 0 and THEN add the ref lines you need. Thanks to both Anonymous and @009co 

Shaurya
Memorable Member
Memorable Member

Hi @nkpenta,

 

I think this issue might provide the information that you need.

 

https://community.powerbi.com/t5/Issues/Analytics-Y-Axis-Constant-Line-bug/idi-p/2226049

 

Works for you? Mark this post as a solution if it does!

nkpenta
Microsoft Employee
Microsoft Employee

thanks. following the link you shared. Issue is still under investigation.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors