Forum Discussion
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
- jdbuchanan71Super 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.
- akhilduvvuruHelper IV
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?
- jdbuchanan71Super 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.
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.
- akhilduvvuruHelper IV
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.
- akhilduvvuruHelper IV
amitchandak lbendlin Ahmedx Ritaf1983 Fowmy Ashish_Mathur Greg_Deckler dm-p
Appriciate your help!Thanks!!