Forum Discussion

TiaCamilian's avatar
TiaCamilian
Icon for Resolver I rankResolver I
6 years ago
Solved

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

 

I need the data in the following format:

 

 

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...
  • Anonymous's avatar
    Anonymous
    6 years ago

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

3 Replies

  • 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]))

     

     

  • Anonymous's avatar
    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

    • TiaCamilian's avatar
      TiaCamilian
      Icon for Resolver I rankResolver I

      Yes it was counting. Now is working.

       

      Thank you