The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
We have a simple chart with dates on the x axis. With a slicer, the user can select the period to be shown. For instance, if "Last week" is chosen:
All fine there. If however we choose a shorter period, for example "Last 3 days", we get :
Note the x axis is now showing not only the dates but also times: 26 Jun 00:00, 26 Jun 06:00, 26 Jun 12:00 etc
How can we force the x-axis to show only dates? For the latter chart, it should only show 26 Jun, 27 Jun and 28 Jun, which is what the three bars correspond to.
Notes: the Date column used in the x axis is of type date (not Date/time) and we would need to keep the x axis as continuous. The selectable periods go from a couple of days up to a full year, with day granularity.
Many thanks
PS: Any idea? @MFelix , @TomMartens @Pragati11 @parry2k @Fowmy @mahoneypat
Thanks
Thanks @mahoneypat @parry2k @MFelix
@TomMartens Thanks very much for the article. It doesn't seem to address my problem though. On the continuous axis, they aggregate down to week level but I want to keep the granularity at day level. It is when I am only showing two or three days that I get this annoying daytimes in the middle. The rest (when showing one or several months) is fine
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
@TomMartens Good article but too much to handle format on the x-axis in continuous. Seems like overkill for that simple talk whereas, in my opinion, it should be out-of-the-box functionality to handle the format. Thanks for sharing.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hey @parry2k , I agree the ideas are a lot to digest for a small task like formatting the date if the axis label is of type continuous, unfortunately, there is no other way, at least no tat the moment.
Regards,
Tom
Hey @AlB ,
please check this article: Improving timeline charts in Power BI with DAX - SQLBI
Hopefully, this helps to tackle your challenge.
Regards,
Tom
@AlB as others described when it is a continuous type on x-axis you cannot control the format of the date. It does pick up the format based on number of visible dates. It is a known functionality..
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @AlB ,
Has previous refer this is a functionality and you cannot control it.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@AlB I couldn't find a workaround with the native visual, so I would just make it with the charticulator visual. I saw same formatting behavior with a line chart and just made a simple charticulator one (on right). You should also be able to use the Tick Format option on the x axis in the plot segment to get it to show mmm dd (but I haven't figured out the D3 syntax for it yet).
Update: I expanded the slicer after I posted the above and it does not look pretty on the x axis. Not the solution (at least the way I did it).
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @AlB
Update 2:
Here is the feedback: "This is currently by design without any formatting options to change. We will review and analyze current logic but no ETA at this time."
So for now I suggest voting for the idea at bottom of this post.
===================================
Update:
I have reported this issue internally (IcM number: 248625217). Will update here if get any feedback. Thank you.
===================================
Currently there is no workaround to format the dates in X Axis to remove the time part when of type continuous. I found a related idea Allow Formatting of Dates in X Axis with Continuous Data
Regards,
Community Support Team _ Jing