Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

X-Axis Constant Line value as conditional formatting does not how on line graph

I have a line graph that shows % on the Y axis and dates on the X.

The graph has a static filter on it that is set to only show dates where the week offset is greater than or equal to -52 (i.e. showing a year of data).

I want to show have a line on the X-Axis that shows where the week offset is equal to -4 (i.e. 4 weeks ago).

I created the following Measure


Week End Date 4 Weeks Ago = 

VAR OneWeekEndSelected = HASONEVALUE(Dates[WeekEnding])
VAR SelectedWeekOffset = IF(OneWeekEndSelected=TRUE,VALUES(Dates[WeekOffset]),99) 
VAR WeekOffSet4WeeksAgo = SelectedWeekOffset-3

VAR Date4WeeksAgo = LOOKUPVALUE(Dates[WeekEnding],Dates[WeekOffset],WeekOffSet4WeeksAgo)

return Date4WeeksAgo


When I look at thie value in a Card it is correct. 

When I add this to the X-Axis Constant Line as a Conditional Fomat, it does not show. 

If I manually type in the date and do not use the Conditional Fomat optoin the lines shows as I want. However as the data grows week on week then next week the fixed date will be 5 weeks and not 4 weeks ago. 


Can anyone advise why the line is not showing when I use a method?



Super User
Super User

You can try to add a measure that computes the -4, and add it to the chart.


Please provide sanitized sample data that fully covers your issue. I cannot help you without usable sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

Helpful resources

Winner of T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Find out who won the T-Shirt Design Challenge and the top 3 finalists.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

Top Solution Authors