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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
akhilduvvuru
Helper IV
Helper IV

Dynamic X-Axis Date format change

Hi Team,

 

I have a requirement to change the format of my bar chart x-axis (Date Field). I have a Period selection in my report with 3 values (Last 10 Days, Last 6 Months and Last 5 Years). So based on my selection,

when I select "Last 15 Days", my x-axis should show daily granularity,

when i select "Last 6 Months", my x-axis should show Month granularity,

when i select "Last 5 Years", my x-axis should show Year granularity.

 

I can make it by creating 3 diff columns with 3 required formats and by using Field Parmaters I can switch my x-axis fields. But that will add an extra click (on top of my period selection) to the end user, which I want to avoid. I want to have a solution with only one Period Selection click.


Can someone help me with any solution to update the format of my x-axis?

 

Thanks!

5 REPLIES 5
akhilduvvuru
Helper IV
Helper IV

jdbuchanan71
Super User
Super User

Curious why you think there would be a lot of maintenance.  On each visual you would set a Relative Date filter to show the appropriate range.
DateRange.png

Set the 3 bookmarks, each to hide the 2 unneeded charts.  Group the bookmarks and assign them to a bookmark navigator.

I have attached my sample file for you to look at.

 

@jdbuchanan71 - When there is any change in the visual, I have to do it 3 times and I have to update the all 3 Bookmarks etc., If missed any one of that then gone.

jdbuchanan71
Super User
Super User

You could do it with bookmarks, have a bookmark for each granularity and use a bookmark navigator to allow user selection.  You would have 3 charts, one for each level and each bookmark would show the one you want and hide the other 2.  You would also set the date range filter on each of the charts, so the right amount of data is show.

Thanks for your response @jdbuchanan71 - True, Bookmarks will work but also comes with good amount of maintainence efforts. I'm keeping Bookmarks as my last option.

 

Do you think of any other alternative approach using DAX?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors