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
croberts21
Continued Contributor
Continued Contributor

How to show line graph data only for today or earlier?

I have PBI desktop v March 2023. We use the import mode to get data. 

I am graphing vacation hours taken in the past and future on a line graph and showing a trend line. However managers often enter vacation up to 6 months ahead of time. By default PBI shows all data in the dataset. I only want to graph the values from today and before. How do I do that? 

I looked in the Visual properties, under Visual tab, then X-axis, then Range, but I cannot enter a formula of "<=today()". The X-axis is my field "Month (bins)" is is the Startdate field grouped by the month.

croberts21_1-1682938604095.png

 

I can choose a fixed date in the X-axis properties but that date will never change, the user would have to update that date manually and that is not an option. I just want to exclude future dates, and graph only dates from today and before.

I also have a slicer where I can choose the pay type of "Vacation" or many other pay types like regular hours or overtime hours. 

 

Thank you!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@croberts21 , You can use relative date slicer at visual filter level 

 

or you can have a measure like

 

calculate([Measure], filter(Date, Date[Date] <= today())

 

You can also try min and max value measure

min measure =  today() -3650

max measure = today()

 

this will cut axis not data

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@croberts21 , You can use relative date slicer at visual filter level 

 

or you can have a measure like

 

calculate([Measure], filter(Date, Date[Date] <= today())

 

You can also try min and max value measure

min measure =  today() -3650

max measure = today()

 

this will cut axis not data

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

Thank you! I actually made a new column:

BeforeToday = IF(EmpTime[Start Date] < TODAY(), True, False)
And set the page filter to show only True values for this column.
 
 

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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