0

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:

Here is the chart

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!

Andrey Nikolov
  • 12,967
  • 3
  • 20
  • 32
Mark
  • 3
  • 2

1 Answers1

1

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"

Giovanni Luisotto
  • 1,382
  • 7
  • 12
  • Thank you for your help. I tried what you say but in first case i put a space between the numbers so i can't change to numeric type. When you write down this idea i saw what was wrong in mine. So it works without space and then i sorted the X values. – Mark Feb 26 '20 at 10:19