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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rishtinz
Helper II
Helper II

X-axis constant line on line chart

I have a line chart where I want to place a constant line on x-axis. I can do that when I have the date in x-axis field in Year-Month-Day hierarchy. As soon as i remove year from it I lose the constant line. I want to put the year in the legend instead. Has anyone been able to plot x-axis constant line on line chart with month-Day date hierarchy only?

 

rishtinz_0-1664913607250.png

 

1 ACCEPTED SOLUTION

@rishtinz You could create 2 measures, one that returns data only up to the milestone and one that returns data only after the milestone and thus have 2 different colored lines that appear contiguous.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@rishtinz Create a Month Day column perhaps? Jan 1, Jan 2, Jan 3. Super odd that the x-axis constant line goes away when you take out Year from the hierarchy but stays if you leave Year in and take out Quarter. I tested this and it is indeed the case.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Arul
Super User
Super User

@rishtinz ,

could you share the screenshot of expected output?

Thanks,





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Here's the output that I want. As you can see I have Year/Month/Day in the date hierarchy and so the x-axis constant works. I believe it works because its expecting a specific date and as soon as I remove year then the line disappears as well. 

 

Now that I am thinking, this might not works since the start of the term is never a fixed date but its usually the first monday of the first week of September. 

 

I wanted to plot a line to indicate a milestone (a date) for a year e.g. the blue line below is the milestone for this year. If I can't do this for multiple years then I guess I need to either label the marker with a different color or the line after the milestone.

 

rishtinz_0-1664921433989.png

 

Anonymous
Not applicable

I am having a similar issue.  In my case, I am using the x-axis constant to indicate "this week" and shade the past weeks along an x-axis with week numbers.  When I attempt to use a custom date hierarchy to facilitate year-weeknumber along the x-axis (i.e., to extend multiple years), this feature disappears from the analytics options. 

How did you ultimately solve your problem?

Any other suggestions from anyone else?

@rishtinz You could create 2 measures, one that returns data only up to the milestone and one that returns data only after the milestone and thus have 2 different colored lines that appear contiguous.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors