si Hwang
si Hwang

Reputation: 307

How to show x-axis with just month and year in line chart?

I plot a line chart from my data in PowerBI. My data is

Month value
August, 2022 89
Septemeber, 2022 100

Month is of type 'Date' and Value is 'decimal'. My line chart only has 2 data point, but when Power Bi draws it, is shows in 'days' instead of months (from my data). enter image description here

I have tried creating a 'Hierarchy' for my X-axis. But that does not solve the issue. enter image description here

Upvotes: 1

Views: 3769

Answers (1)

davidebacci
davidebacci

Reputation: 30289

Change the axis type to categorical. For more control, you'll need a date table https://radacad.com/power-bi-date-or-calendar-table-best-method-dax-or-power-query.

enter image description here

Upvotes: 1

Related Questions