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
tjeffries
Helper I
Helper I

help with switch previous month current month

Hi I'm using the switch function, to replace month number with month name, I need to replace any month name in the past with the current month i.e. replace May with Jun

 

here is what I have so far

Order date =

SWITCH (

   orders[est ship date Month Number],

    1, "JAN",

    2, "FEB",

    3, "MAR",

    4, "APR",

    5, "MAY",

    6, "JUN",

    7, "JUL",

    8, "AUG",

    9, "SEP",

    10, "OCT",

    11, "NOV",

    12, "DEC",

    BLANK (),"No ship date"

)

 

can this be done using the switch?

2 ACCEPTED SOLUTIONS
v-easonf-msft
Community Support
Community Support

Hi , @tjeffries 

If I understand your request correctly, you want to convert the past month to the current month  and the future month remains unchanged.

You may refer to this sample pbix file .

pbix attached

 

1.png

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you so much it worked perfectly!

View solution in original post

5 REPLIES 5
v-easonf-msft
Community Support
Community Support

Hi , @tjeffries 

If I understand your request correctly, you want to convert the past month to the current month  and the future month remains unchanged.

You may refer to this sample pbix file .

pbix attached

 

1.png

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you the file worked I did want to convert the past month to the current month and the future month remains unchanged.  However I forgot that the months that are blank need to say "no date".  Can you help.. please

Hi , @tjeffries 

Please check the new pbix file.

pbix attached

 

Best Regards,
Community Support Team _ Eason

Thank you so much it worked perfectly!

amitchandak
Super User
Super User

@tjeffries ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.