Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Community,
I've got the following X-axis (no scrollbar), but when I choose EOMONTH, the datapoints don't represent the actual graph.
Is it possible to create a line-chart visual without a scrollbar, but with actual weeks, like 2020-18 - 2020-19 etc. etc.
The format of the week is text and 2020-18 / 2020-19. When I try to make this number/date, for example 202018; between 202052 and 202101 there is a lot "white"space;
In excel you can take the labels and there it is. Here, in PBI I find this very hard. Can someone help me? Thanks!
@hansreivers
There is not much you can do if you want a continuous yy-ww format in your x-axis than to resize the chart (if possible).
Power bi will try to show all the data available at the field selected for the x-axis and therefore the need of a horizontal scroll bar.
If a Text field is used in the x-axis the scroll will appear to guaranty that all that categorical data is shown in the x-axis. If you still need the x-axis with categorical data, there is no way to avoid the horizontal scroll, except to resize the visual object -if possible-. The same thig will happen to a year/week hierarchy (even though the fields year and week were formatted as numbers).
If you want to format yyyyww as a number and use it in a continuos x-axis to avoid the scroll then you won´t get values after week 52/53 (some years can have 53 weeks), and therefore that "white space" (from week 52 until 1st week of next year) in the line chart.
Hope this make more clear the situation.
@hansreivers - did we resolve your issue? If we did, please select the appropriate solution, it helps with visibility for others and for SuperUsers to keep their status! Thanks!
Hi Mark,
Sorry for the delay, but unfortunately not. I'm still trying. I maybe have to create an end of week date, but I can't get it right.
@hansreivers - I spoke earlier of creating a date table using Power Query, did you check the link I posted for you?
Once you have done that, there is a specific M Code function that will create the end of week date, you can add this into the code I have linked you to:
https://learn.microsoft.com/en-us/powerquery-m/date-endofweek
If you are trying to handle this in DAX it will be much harder. Use Power Query to create date tables always.
If this helps, please accept as the solution.
Hi @hansreivers ,
As far as I know, if you choose Categorical as X-axis Type, it will show all data in this column.
I'd recommend choosing the X-axis Type as Continuous so that you don't get a scrollbar.
You can hover your mouse on this visual and it will show detail week numbers.
Or you can choose show as table to see details.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
In order to view this by weeks in the format you wish, you'll need to create a date table - best way to do this is using Power Query.
There are lots of blogs out there with code that'll get you started on creating a date table, this is one of the best:
https://blog.enterprisedna.co/introducing-power-query-extended-date-table-v2/
You might find it already has the week in the format you want.
If this helps, please accept as the solution to assist others with the same challenge.
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
9 |