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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to put mark line in the line graph

Hi,

 

I have a line graph custom visual that shows project progress over the date but I need to put the vertical mark line to show today date.

This is for we know the progress data for the current date.

 

The current graph

 

2020-07-28_2356.png

 

The mark today line need to add in the graph

2020-07-28_2356_001.png

7 REPLIES 7
amitchandak
Super User
Super User

@Anonymous ,

create measure filtered on today()

new meaure =calculate([old measure], date[date]=today())

 

display market for this.

 

something like here. a measure is just created for last point

https://community.powerbi.com/t5/Community-Blog/Display-Label-Only-on-the-Last-Data-Point-of-the-Line-Visual-for/ba-p/1253464

 

Your point is today

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
andre
Memorable Member
Memorable Member

you can use a "Line and clustered column chart" visual where you use line as is and you will have to create another measure for the mark bar and use that in Column Series.  THE MOST IMPORTANT THING IS - you have to make sure that Align Zeros is set to ON to make sure that both graphs are using the same scale

Anonymous
Not applicable

Hi @andre what is the measure DAX that I need to add.

 

the measure that will return the value of sales (or whatever you are trending in the line) but only for today

 

so markTodayLine = if(selectedvalue(calendar[date]) = today(), [sales], blank())

 

or something like that

andre
Memorable Member
Memorable Member

here is a video on how to add TODAY marker to a trend chart:

 

 

you can download the desktop file with the example used in the video here: https://businessintelligist.com/2020/07/28/how-to-show-today-on-a-trend-chart-quick-dax-tutorial/

Anonymous
Not applicable

Hi, @andre and @amitchandak,


I try testing both measures as suggested but my today measure is 0 data. 

My line graph data is a measure DAX data that I produce to be interactive with the selection slicer and I have two line graph is for Actual and Planned data


Example line graph Dax measure

Planned Design =
IF(ISCROSSFILTERED('Contract Package'[Contract Package]),
SWITCH( TRUE(),

VALUES('Contract Package'[Contract Package]) = "CP101" , [Planned CP01 D],
VALUES('Contract Package'[Contract Package]) = "CP102" , [Planned CP02 D],
VALUES('Contract Package'[Contract Package]) = "CP103" , [Planned CP03 D],
VALUES('Contract Package'[Contract Package]) = "CP104" , [Planned CP04 D],
BLANK()), VALUE([Planned Overall D]))


Another measure that related to line measure above

Planned CP01 D = SUMX(Design,Design[CP01 Planned])

 

Im glad if you would like to see my dashboard.

@Anonymous , In case that question was for me, the old measure is the measure that you have used for the line where you want to highlight today. If you need for the both then create two new measures.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors