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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Sushant__08
Regular Visitor

To update length of Month Numbers

Dear All,

 

Currently, month numbers are listed as M1, M2, ~~ , M10, M11 ~~, M100, M101, etc in an excel imported to Power BI.

 

I want to add a new column in Power BI assigning month numbers as M001, M002, ~~, M010, M011, ~~ , M100, M101, etc.

 

This is to align month number in X-axis in an ascending order.

 

I tried roughly in excel and following formula seemed to work:

Sushant__08_0-1721972754839.png

=IF(LEN(A3)=2,LEFT(A3,1)&"00"&RIGHT(A3,1),IF(LEN(A3)=3,LEFT(A3,1)&"0"&RIGHT(A3,2)))

 

Can anyone help me to prepare a similar formula in Power BI to add a new month number column ?

 

Thanks in advance.



1 ACCEPTED SOLUTION

How about these formula?

mickey64_0-1721974575488.png

 

mickey64_1-1721974737174.png

 

View solution in original post

3 REPLIES 3
mickey64
Super User
Super User

For your reference.

 

mickey64_0-1721973496643.png

 

mickey64_1-1721973525758.png

 

 

 

 

 

Thank you sir for a reply. I think it would have worked if there was only numerical value. But the month number column has an alphabet (M) as well.

Like, M1 --- > M001 etc.

Could there be any other option to prepare an updated column ?

 

Regards,

How about these formula?

mickey64_0-1721974575488.png

 

mickey64_1-1721974737174.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.