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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors