Power BI X axis issue with days and hours - powerbi

I'm new in Power BI and I would like to a create a line chart, with Selected Days and Hours on X axis, and the sum of values on Y axis in a selected Year. For example:
As you can see I could do it, but with a scrollbar. I can't change the X axis type to continous because days (Monday, Tuesday etc.) are string. So I made a column with integers (like 1 is Monday, 7 is Sunday etc.). But it doesn't work either.
I would like to see the whole chart on page without scrollbar.
Let me know if it is possible, thank you!

In order to use a "continuous" X-axis you need to have a numeric column, in your case, even if you replace the "day name" with its corresponding number the value will be a string ie: "Saturday 11" → "6 11", also check the current data type of the column, maybe you just need to set it as number.
Now let's say you make a meaningful number to represent your data and use a continuous X-axis, you won't have a scrollbar anymore, but you also won't be able to see all the values of the X-axis (you might see a value label every 5-10-20 values), and there is also the sorting to take into consideration.
About the X-axis sorting, as of now, it looks totally random to me. Since the chart context is given by "year", to have a meaningful sorting of your dates you need at least a sorting key that represent Month and Day, if you want to use it in the axis itself as a number it should be in the format "MMDD"

Related

Line chart in Power BI not showing all of my data?

I have a line chart in Power BI that tracks different metrics over time. The X axis is week number (e.g. 1st week of the year is 1 and so on). A slicer is used to select which weeks to look at.
However, no matter what's selected on the slicer the chart only goes up to week 12:
I've confirmed that the table this chart gets data from is fully populated up to week 14. If I add a card to the report holding any of the metrics used in the chart, they show data for weeks 13 & 14.
If I go into the x axis settings and set the end of the axis to 14 the axis goes up to 14 but the chart still shows no data beyond week 12.
Does anyone know what the problem might be please?
If it helps, the x axis is set to type = continuous and scale type = linear.

Having trouble building chart from multiple columns in Power BI

I would like to create a simple chart from 2 or more columns in Power BI.
Here's my data, for each column, a 1 marks an occurrence of an event, null means it did not happen.
I would like to turn this data into a very simple bar graph, showing both these fields' numeric totals (i.e. summing all the 1's). The bars would be shown side by side. I would like it to look exactly like this, only instead of male/female it would show "alcohol occurrences" and "MDMA" occurrences.
Here's my stacked column chart:
And when I try and put the column names on the axes so that they can be properly labeled, I get this:
I can achieve most of what I want using a clustered bar chart, but the problem there is that it won't let me label the axis with the alcohol / MDMA column names:
How can I make a simple, labeled graph, stacking both columns up against each other, showing the numeric sums for each column? Again, I want it to look exactly as the male/female example shown above. Is this even possible? Thank you in advance.
In the above scenario, all the values are considered to be in the same category and that means there is no direct way to do this. There are a couple of workarounds to make it look like the desired output:
To get the gap between the two bars:
You should create a new measure, Measure New = 0
Add this measure in the middle of the two values in the bar chart
This should give you a gap in between the two bars
To get the axis values added:
Create two text boxes with the text "Alcohol" and "MDMA" added
Place these text boxes below the respective bars to make it look like they are the axis values
These workarounds can become quite tedious when you have to do it for a larger number of charts/values. On a lighter note, it baffles me that you can consistently come up with these specific scenarios where you expect the charts to do exactly the opposite of what they are meant for 😉

Scatter chart Play Axis is limited to 10 elements

In a Power Bi report I'm using a Scatter Chart (bubble) with a Play Axis (months).
But this one is limited to 10 elements (I tried years, days, weeks... always 10). Also it's not a size problem, I already tried to put it on maximum size.
And I would like to have 12 elements (all months). How can I fix that?
[https://i.stack.imgur.com/QkW7f.png]
Thanks a lot
The scatter chart does not limit the play axis to 10 items, the value for those remaining items are null/blank due to which the play axis does not show those values. Please find below the screenshot. So please check the data for those missing categories.
Thanks.

Clustered Column Chart bars get squashed when more than one year of data monthly data is included

When I have more than one year of monthly data in my Clustered Column chart my data bars get squashed and separated with the x axis type set to Continuous. Setting the x axis type to Categorical fixes the problem but I lose the Trend Line. The Trend Line is a must-have requirement from the end user so I can't leave it out.Desired Result but I need a Trend Line
This is what happens with the x axis set to Continuous:
When I reduce the amount of data to 12 months everything is ok - bars look good and I have a trend line - surely I should be able to display more that one year's worth of data?
This is what I want but I want to display more than one year's worth of monthly data
your suggestion seemed to work for the most part but my Month Year labels aren't lining up with the correct columns. For instance Jul 2019 should be directly under the right-most columns. Also, how can I get Month Year labels under every column not just every few.
Note that the Month Year labels seem to be shifted one column to the left

Google Chart Date X-Axis not proportionate to length of time

I have a simple chart plotting data over time. The data points are taken at random time intervals, and I would like the chart X axis (time) to actually reflect the interval between these dates. Currently the x axis always uses the same spacing between two dates, regardless of the span of time covering the delta.
Thanks!
https://developers.google.com/chart/interactive/docs/gallery/annotatedtimeline
should do what you want. It has support for graphing using dates.