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
Anonymous
Not applicable

How do I make a chart for x-axis be dynamic or match relative date filter?

I have a simple line chart that needs to change to the current month each month. Currently I deal with this by on the start of each month I  change the data range to the current start and end date of the current month. Is there a way to get PowerBI to do this automatically based on the current month? See screen shot below

 

dynamic2.png

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can create a measure as below and make the visual filtered by it.

Measure 2 = var ym = FORMAT(TODAY(),"yyyymmm")
var ymi = FORMAT(MAX('date'[Date]),"yyyymmm")
return
IF(ym=ymi,1,BLANK())

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can create a measure as below and make the visual filtered by it.

Measure 2 = var ym = FORMAT(TODAY(),"yyyymmm")
var ymi = FORMAT(MAX('date'[Date]),"yyyymmm")
return
IF(ym=ymi,1,BLANK())

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Tahnks so much. Can you give me more background on what a Measure is and how it's used conceptually?

amitchandak
Super User
Super User

You are already using relative date level filter in filter panel, is that not working for you?

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.