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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ericsara
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?

 

Thanks, 

1 REPLY 1
lbendlin
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.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.