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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Changing which month is first through a dax code

Hello,

i have "months owned" list for a boat engine company who starts their fiscal year in may. I am trying to figure out how I can change powerbi to recognize May as month 1, June as month 2, July as month 3, etc. ; (as opposed to January, Februrary, and March being months 1,2,3)

Can this be done through a dax code?

 

Thanks

 

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

So, yes. Not much information to go on but you could use a SWITCH statement to return whatever values you want for whatever, like this:

 

My Month =
  SWITCH(MONTH([Date]),
    5,1,
    6,2,
    7,3,
    8,4
    ...
   )

However, you may get more mileage out of a quick Enter Data and plug in your own information there. In either case, you could use this as a Sort By column.

 

Really tough to say one way or the other given the information provided.  Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.