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
ParsaOmidvar
Frequent Visitor

X Axis constant Line

I want to add X axis Constant Line to Line And Clustered Column Chart, My X axis is Index and stored as String not Numeric or Date Data Type. How Can I Work Around That? 

1 ACCEPTED SOLUTION
5 REPLIES 5
Anonymous
Not applicable

Hi,@ParsaOmidvar .Has your problem been solved?
If you have found suitable solutions, please share them as it will help more users with similar problems.
Or you can mark the valid suggestions provided by other users as solutions.
Thank you very much for your understanding and support of Power BI.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian

Anonymous
Not applicable

Hello, tharunkumarRTK ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@ParsaOmidvar .I am glad to help you.
I agree with tharunkumarRTK 's suggestion.
If you add a Constant line with an incorrect data type. You can try to create a measure with the same calculated effect and set the correct data type for it and add it as the value of the Constant line in the visual
Like this:

vjtianmsft_0-1733107922718.png

vjtianmsft_2-1733108108238.png

 


You need to make the data type of measure consistent with the X-axis field type
The constant lines added are related to the data types of the X-axis and Y-axis fields.

vjtianmsft_1-1733107963692.png

I hope you find the following related article helpful.
URL:

Add a Constant Line to a Line and Clustered Column Chart in Power BI


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for your time, but it was way more complicated than this, I read a post which used error bars to dinamically creates vertical lines in a visual when specific criteria met.

ParsaOmidvar_0-1736067912608.png

 

tharunkumarRTK
Super User
Super User

@ParsaOmidvar 

 

If I understand correctly you want to add a constant line to a Line and clustered chart. If yes then you can create a measure which results into a constant value and add that measure into line field of the visual.

 

Line and clustered support adding a constant or reference line, so I would suggest you to create a meausre and plot that as a line 

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

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.