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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.