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
rishtinz
Helper I
Helper I

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.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

@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.


@ 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!:
The Definitive Guide to Power Query (M)

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

 

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.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.