Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi Guys,
I'm trying to figure out if there is a possibility to work with a dynamic constant line. My current visual is based on healthcare data. What I can show them right now is the running total based on a year. The constant line shows me the budget based on a hardcoded budget. See picture below:
What I want, when I choose for another year in the filter, my budget (constant line) changes automatically. Is there a possibility to achieve this?
Thanks in advance
Solved! Go to Solution.
I'm afraid this couldn't be achieved because the value of constant line is determined by constant value, it can't be changed by slicer. As a workaround. I would recommend you to create a measure using DAX like pattern:
Measure = SELECTEDVALUE ( table[value] )
And then drag the measure to your chart.
Regards,
Jimmy Tao
Another approach/trick that worked for me was:
Hello @marcoselias I tried the steps as following. However the constant line has no value showing. The target should be 5.2bn. Any suggestions. thank you
I found, that is possible to achieve that. Using this steps:
1. Create a Measure that have the desired values, according with the value of slicer. It could be in a form of if statement. If selected value is x then y.
2. Add constant line in Analytics section. In the value, you can select the fx logo an then you can base the value of this constant line based on your measure. Now based on selection, your constant line (or threshold) will change.
Is the measure that you are going to use as a constant line evaluating to the 5.2bn that you are expecting? you can verify this with a card visual and dragging the measure to the Fields well. If it is evaluating correctly, did you drag the measure as a value of the visual (step 3 above) before going to the analytics tab to add a new Min Line, Max Line, etc. (step 4)? Also, double-check the formatting of the line in case its color blends with the background of your visual (step 5). Good luck! Don't forget to flag a a solution as it may help others.
Hi @marcoselias could you please attach a sample file with implementation if possible..would be very helpful
Very clever!
Thanks, I can't believe this worked and did exactly what I was looking for! One point of clarification I would add is with step 3. I had to set the value of the visual to the measure as I could not figure out how to "Add the measure with the constant value to your list of values of the visual". It set all of the bars to the measure but, once I went to Analytics and set the max line to this measure, I was able to set the original value back in the visual and the max line stayed set to the measure.
What I want, when I choose for another year in the filter, my budget (constant line) changes automatically. Is there a possibility to achieve this?
The "constant line" you mentioned is the constant line option in Analytics pane, right? If it is, what does "based on a hardcoded budget" mean? Could you clarify more details about the cuurent settings and your expected result?
Regards,
Jimmy Tao
Thanks @v-yuta-msft for your reply.
The constant line in the analytics pane that's right.
How i implemented the constant line right now:
My value in column "Waarde" is hardcoded. But actually I want this value to change dynamicaly when I change the year filter on my report. Is there a possibility for this?
I'm afraid this couldn't be achieved because the value of constant line is determined by constant value, it can't be changed by slicer. As a workaround. I would recommend you to create a measure using DAX like pattern:
Measure = SELECTEDVALUE ( table[value] )
And then drag the measure to your chart.
Regards,
Jimmy Tao
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
146 | |
72 | |
63 | |
52 | |
51 |
User | Count |
---|---|
208 | |
91 | |
62 | |
59 | |
56 |