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

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

Reply

Questions about new x-axis constant line

Love the new x-axis constant line but can't figure this out.  Maybe it is not possible?

 

First question: can you have a constant line show every x period e.g 01 July of every year, or 01 of each month?

 

Second question: is it possible to use a dax measure instead of manually inputting the constant line, e.g set it to always be first day of previous month?  That way it automatically stays relevant without having to manually change it every month.

1 ACCEPTED SOLUTION
DataZoe
Microsoft Employee
Microsoft Employee

Hi @dapperscavenger , It is a very cool feature but I don't think it can do measures just yet! You can get the same functionality by changing a line chart to a combo chart, then adding this measure to the columns (keeping the others on the lines):

First Day Last Month =
var month = month(TODAY())-1
var year = if(month = 0, year(today())-1,year(today()))
var month2 = if(month=0,12,month)
var lastmonthdate = date(year,month,1)
return
if(SELECTEDVALUE('Date'[Date]) = lastmonthdate, 1, blank())
 
DataZoe_0-1617413776334.png

 

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/

View solution in original post

1 REPLY 1
DataZoe
Microsoft Employee
Microsoft Employee

Hi @dapperscavenger , It is a very cool feature but I don't think it can do measures just yet! You can get the same functionality by changing a line chart to a combo chart, then adding this measure to the columns (keeping the others on the lines):

First Day Last Month =
var month = month(TODAY())-1
var year = if(month = 0, year(today())-1,year(today()))
var month2 = if(month=0,12,month)
var lastmonthdate = date(year,month,1)
return
if(SELECTEDVALUE('Date'[Date]) = lastmonthdate, 1, blank())
 
DataZoe_0-1617413776334.png

 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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