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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nkpenta
Employee
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
Employee
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

5 REPLIES 5
nkpenta
Employee
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.

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!

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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