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
dommyw277
Helper II
Helper II

Right or Mid Return Amount of Characters

Hi, im trying to create a custom column to return the month , not having much luck, heres my column:

[Month_Type] Azure July 2022 

I just want to get the month in another column please

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @dommyw277 

 

You could create a column as below:-

month_col =
SWITCH (
    TRUE (),
    CONTAINSSTRING ( table[_column], "January" ), "January",
    CONTAINSSTRING ( table[_column], "February" ), "February",
    CONTAINSSTRING ( table[_column], "March" ), "March",
    CONTAINSSTRING ( table[_column], "April" ), "April",
    CONTAINSSTRING ( table[_column], "May" ), "May",
    CONTAINSSTRING ( table[_column], "June" ), "June",
    CONTAINSSTRING ( table[_column], "July" ), "July",
    CONTAINSSTRING ( table[_column], "August" ), "August",
    CONTAINSSTRING ( table[_column], "September" ), "September",
    CONTAINSSTRING ( table[_column], "October" ), "October",
    CONTAINSSTRING ( table[_column], "November" ), "November",
    CONTAINSSTRING ( table[_column], "December" ), "December"
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
JorgePinho
Solution Sage
Solution Sage

Can you show me the original column?

Samarth_18
Community Champion
Community Champion

Hi @dommyw277 

 

You could create a column as below:-

month_col =
SWITCH (
    TRUE (),
    CONTAINSSTRING ( table[_column], "January" ), "January",
    CONTAINSSTRING ( table[_column], "February" ), "February",
    CONTAINSSTRING ( table[_column], "March" ), "March",
    CONTAINSSTRING ( table[_column], "April" ), "April",
    CONTAINSSTRING ( table[_column], "May" ), "May",
    CONTAINSSTRING ( table[_column], "June" ), "June",
    CONTAINSSTRING ( table[_column], "July" ), "July",
    CONTAINSSTRING ( table[_column], "August" ), "August",
    CONTAINSSTRING ( table[_column], "September" ), "September",
    CONTAINSSTRING ( table[_column], "October" ), "October",
    CONTAINSSTRING ( table[_column], "November" ), "November",
    CONTAINSSTRING ( table[_column], "December" ), "December"
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

JorgePinho
Solution Sage
Solution Sage

Select that column and then go to Add Column > Extract > Text Between Delimiters.

JorgePinho_0-1675157153341.png

On the Start and End delimiter insert a space.

Then open advanced options and change "Number of start delimiters to skip" to 1.

 

Thans, this is what it gives me though

 

textpowerbiright.JPG

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.