Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Formatting x-axis date from Year to Month-year

I have data from June 2021-Jan 2022. The x-axis contains the dates and y-axis contains the value on that date. Power BI is showing just two values on the x-axis, 2021/2022. I would like to have it June 2021, July 2021... etc. Anyone know how to achieve this? Picture is shown below.

 

XYZ1233_0-1641381534925.png

Here is also a snippet of my data.

 

XYZ1233_1-1641381585995.png

Does anyone know why the value on the y-axis is then going to like 0.5 billion when it should be around 3000 max?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I managed to do it. All I needed to do was change from date hierarchy to DateTime in the axis field.

View solution in original post

11 REPLIES 11
visheshjain
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

I think I agree with @amitchandak that you need the MTD measure for the graph that you are trying to achieve.

 

You can share your file from google or one drive by inserting the link or you try to attach the file by clicking on insert media.

 

Thank you,

 

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



visheshjain
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

I do not know your data completely, but from what I can see is that the Y-axis is summing up all the values since you have only a single date.

 

You will need a calendar table and probably another table for time, if you plan on using the time field.

Else you can convert the data type of the column into a date and remove duplicates so that you have only 1 entry per date.

This is more of a modeling problem, the solution to which will depend on what you are trying to visualize through your data.

 

Thank you,

 

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



Anonymous
Not applicable

Hi @visheshjain 

 

See my response to amit. I am not sure what to do to get the correct value for the value column.

amitchandak
Super User
Super User

@Anonymous , Create a date column without time

DAX

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

 

In power query

DateTime.Date([datetime])

 

Join with date table

with columns

Month Year = FORMAT([Date],"mmm-yyyy")
Month Year sort = FORMAT([Date],"yyyymm")

Sort Month year on Month year sort

 

Join date of table with date of date and plot data using month year of date table

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

 

Thanks. I tried this and got this.

 

XYZ1233_1-1641385932794.png

The shape I am expecting is shown below.

 

XYZ1233_2-1641386021133.png

 

Do you know why I am not getting this? I am guessing it's because of the sum of values option selected but not sure what I need to change it to.

 

I just want power bi to plot the value at each date, like in excel.

 

XYZ1233_3-1641386142119.png

 

Hi @Anonymous ,

 

In the values field, select 'don't summarize' and I think this should work, as it will just plot the points.

 

If this does not work, then please can you share a sample data and I'll try to work on it.

 

Thank you,

 

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



Anonymous
Not applicable

@visheshjain 

 

I have already selected don't summarize but when I drag it into the Values field for the line graph, it automatically selects sum and makes me select at least one of the options such as sum, count etc. I don't seem to have an option to attach files? Not sure if my account has permission for it. Pictures below show what I am saying though.

 

XYZ1233_0-1641388180332.png

 

XYZ1233_1-1641388216949.png

 

 

@Anonymous , I think you need to use datesmtd

 

a measure like

CALCULATE(SUM(Table[value]),DATESMTD('Date'[Date]))

 

use date from date table on axis

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

 

Sorry, not sure I follow. I have all my data in just one table as below. Ignore the third column.

 

XYZ1233_0-1641389143754.png

 

The last 3 columns were added as you wrote above and I used the month year column as my axis and Value for value. Using date as my axis would just give 2021/2022 in the line graph. See my response to @visheshjain to see what the problem was. 

 

@Anonymous , the shape you wanted is only possible when you use date on axis. That too from the date table. Joined with date and created MTD measure as shared above

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I managed to do it. All I needed to do was change from date hierarchy to DateTime in the axis field.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors