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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kamaizziati
Helper IV
Helper IV

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

@Kamaizziati ,

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

 

Your point is today

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

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/

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.

@Kamaizziati , 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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors