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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Add a constant line for 'Line & Clustered column chart' = Combo chart

I am looking for a way to add a constant line - 5% dotted line in my combo chart ' Line & Clustered column chart' 

Combo chart configuration. 

akiko_lim_0-1597850605628.png

 

Chart would like this:-

akiko_lim_1-1597850705070.png

 

Currently the analytics pane for combo chart  doesn't contain a  "+ Constant"  to let me draw a 5% constant line. 

akiko_lim_2-1597851286632.png

 

However, for other visuals - like regular bar chart, it comes with 'Constant line' feature. 

akiko_lim_3-1597851356662.png

Which gives me the result I need on the 5% dotted constant line

 

akiko_lim_4-1597851419204.png

 

How to achive a constant line for ComboChart above?

 

 

13 REPLIES 13
amitchandak
Super User
Super User

@Anonymous , check if you can create a measure and add a like

 

measure =.5

 

add that in the combo visual and change line style

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This is awesome, It worked perfectly Thanks

Anonymous
Not applicable

Had tried the measure approach as well.

Since the primary Y axis is %, and 2nd Axis is number. (2 different unit of measurements)

If I add a "measure 5" to my combo line chart. it will become like this:- which is not what I want.

Black bars = 5%

akiko_lim_0-1597852042392.png

@akiko_lim You should be able to move it to the line values:

combo.JPG

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Anonymous
Not applicable

Thanks DataZoe for your quick reply. very much appreciated. 

 

If I move the 5%line to line Values, my 2nd Y-Axis UoM (unit of measure) will not be correct. 

 

I am mixing Pecent data (5%) line with other # of Test (whole number) . My chart will not be correct. 

See below, 2000% 

 

akiko_lim_0-1597865937270.png

 

@Anonymous oh you are right, I mis-read. I thought your %'s were on the line, not the columns. And you did such a good job explaining it with screenshots too -- my apologies! I'll give it some more thought, but I'm not sure how you would do this with the %'s on the bars. 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

 

If your LINE Axis values are FIXED, you can calculate based on the position of the Bars, the correct Value of 5% to hard code (guessing around '5%Line = 80' or so based on the line axis) to fake this....  But if your Line Axis is variable based on the data selected, this work-around won't work.

 

OR...  do you REALLY want to SUM all values of the LINE, then divide by the number of days, then divid by .05 to Calculate the true 5% mark compared to the Top Line?  If there's possibily some true relation between the Bar and Lines?

 

FOrrest




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Anonymous
Not applicable

In my case here, the 5% line is a "reference point" for the % values on Bar. - which is my primary Y-Axis. (left axis) 

5% line has nothing to do with the other lines being plotted on 2nd Y-Axis (right axis). 

 

 

 

 

 

 

I don't recall if you said your right Axis was fixed or variable?  If It's fixed, I created this measure  

     5%Line = 180

to approximate the 5% goal...  This only works if the right Axis (Line #'s) are fixed (not based on a filter or selection), or you want to re-adjust this measure every time you update the report?

fhill_0-1597925456883.png

 

If it's variable, I have another idea to Calcuate the difference betewen the MAX and MIN % values shown (to determine the scale of the bars), then use 5% of that difference to MULTIPLY by the lowest LINE Value....   I'll try this next if the above work-around doesn't help...

 




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Anonymous
Not applicable

Hi fhill, 

thanks for your suggestion below. To create the calc line would work to provide "visual clues". However, the tooltip when you hover the cursor over it will not be accurate. Won't show 5% line. 

 

Alternatively,  to switch the data around, let the % be on the 2nd Y. Let me verify with product manager if this visual will be meaningful to user. 

 

Appreciate your inputs! it's been very helpful to have other folks comment to verify I didn't miss any features available with this native chart. 

 

 

akiko_lim_0-1597926992865.png

 

 

You are right about the Tool Tip for sure.  If they decide they are OK it showing a fake value instead of '5%'.  Here's the math to figure out your calculated line regardless of the values for Bars or Lines.  ** HOWEVER, All Axis 'Start' values need to be set to 0! **

 

fhill_0-1597928465635.png

 

** P.S.  I do things very broken apart to show my thoughts / steps...  Feel Free to condense this into one Measure if wanted / needed. **  (Or can someone else do so for us?)

 

Max_Bar = CALCULATE( MAX('Table'[%]), ALLSELECTED() )
5%Bar = [Max_Bar] / 0.05
Max_LINE = CALCULATE(Max('Table'[Value]), ALLSELECTED() )
Max_Line / 5%_Bar = [Max_LINE] * ( 1 / 'Table'[5%Bar])

 

fhill_1-1597928514764.png

 

 




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Anonymous
Not applicable

Thanks fhill for your sharing the DAX on your solution you proposed. Got it. Thanks again. 🙂 

DataZoe
Microsoft Employee
Microsoft Employee

@Anonymous You could create a measure:

 

Constant 5% = 0.05

 

then add that as an additional line in the combo chart with your existing % Outliers measure. You can then format it to be red and dashed.

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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