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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
bdehning
Post Prodigy
Post Prodigy

Year and Month on Clustered Column Chart

bdehning_0-1696474372453.png

 

I have a Date Field in my table with Format 12/17/2022.

 

What is the easiest way to extract Year and Month from the Date Field so I can create an X-Axis like above with Month over the Year?

2 REPLIES 2
ChiragGarg2512
Solution Sage
Solution Sage

@bdehning , In clustered column chart, when putting the date column in x-axis right click on the column and change to date heirarchy or it should be applied as date heirarchy. Remove Quarter and day from that date heirarchy and what is left is the result that is aksed.

ChiragGarg2512_0-1696476253862.png

 Thank You.

amitchandak
Super User
Super User

@bdehning , I assume the data type is date.

 

Create a date table with these columns and join the date of the date table with date of your table

 

And Use Year and month from Date table on axis

 

Calendar = Addcolumns(calendar(date(2012,01,01), date(2024,12,31) ), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Qtr Year", format([date],"yyyy-\QQ")
, "Qtr", quarter([date])
, "Month",FORMAT([Date],"mmm")
, "Month sort", month([DAte])
, "FY Year", if( Month(([DAte])) <7 , year(([DAte]))-1 ,year(([DAte])))
, "Is Today" ,if([Date]=TODAY(),"Today",[Date]&"")
,"Day of Year" , datediff(date(year([DAte]),1,1), [Date], day)+1
, "Month Type", Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY") )
,"Year Type" , Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
)

 

 

Sort month on month sort column

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

 

It should off by default, if needed

 

Concatenate Label off : https://youtu.be/QgI0vIGIOOk

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors