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

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

Reply
TiaCamilian
Resolver I
Resolver I

Replacing months by numbers

Hi,

I need to replace the Year-Month with a value like Month1, Month2 etc...

I need to put __Total next 11 months and __Total 12 months back togeter

Month.png

 

I need the data in the following format:

 

Monthnew.png

 

Can someone help me understad how I make this change to the date column

I am using:

 

__MonthNo1 = SWITCH(HireVihecle[__FormathMonth],
"January", -1,
"February", 2,
"March", 3,
"April", 4,
"May", 5,
"June", 6,
"July", 7,
"August", 8,
"September", 9,
"October", 10,
"November", 11,
"December", 12
)
 
But I am getting differemnt numbers:
1 = 2056
2 = 5262
3 = 11169
 
Why am I getting these numbers and not just the 1, 2, 3 etc...
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@TiaCamilian 
I guess the numbers are getting summarized. Just select the visual and right click on the __MonthNo1 field and select Don't summarize

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@TiaCamilian 
I guess the numbers are getting summarized. Just select the visual and right click on the __MonthNo1 field and select Don't summarize

Yes it was counting. Now is working.

 

Thank you

nhoward
Resolver I
Resolver I

Assuming that your field _Date11 is formatted as date, and that you are happy that Jan = 1 and Feb = 2

 

MonthNo = MONTH(LASTDATE(table[_Date11]))

 

 

Helpful resources

Announcements
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.