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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
some_analyst
Helper I
Helper I

Additional functionality for a graph showing a vertical line and a text

Is there a way to work with a line graph and add a vertical line which shows the current week and a label for it which says "This week", like in the picture below - so far I have it a manual line, but I would like it dynamic as weeks progress

 

some_analyst_0-1743650965671.png

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hola @some_analyst

Yes, you can create a constant line of the X-axis with a date returned by a measurement.

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-analytics-pane#use-the-analytics-...

A small example is attached.

For example, create this measure that determines the start date of the week based on the TODAY() function. You can use any other logic you want to determine your desired date:

Week Start Date = 
VAR TodayDate = TODAY ()
VAR Result = TodayDate - WEEKDAY ( TodayDate, 3 )
RETURN
    Result

Then add a reference line of type Constant line on the X-axis, with the value set in the measure (by clicking fx).

OwenAuger_0-1743654161773.png


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hola @some_analyst

Yes, you can create a constant line of the X-axis with a date returned by a measurement.

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-analytics-pane#use-the-analytics-...

A small example is attached.

For example, create this measure that determines the start date of the week based on the TODAY() function. You can use any other logic you want to determine your desired date:

Week Start Date = 
VAR TodayDate = TODAY ()
VAR Result = TodayDate - WEEKDAY ( TodayDate, 3 )
RETURN
    Result

Then add a reference line of type Constant line on the X-axis, with the value set in the measure (by clicking fx).

OwenAuger_0-1743654161773.png


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.