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
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
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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.