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
lardo5150
Employee
Employee

Unable to switch number to month name

I am creating a DataFlow in Power Apps.

My Query is pulling from two SPO lists

I have been able to add a column based on the date in another.  This new column is called MonthNumber.

I am trying to convert the month number into MONTH.

I have tried the following:

SWITCH (
    [MonthNumber],
    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 ()
)
 
and..
 
Format([MonthNumber],”MMM”)
 
I keep running into the same error:
 
Expression.Error: The import SWITCH matches no exports. Did you miss a module reference?
or
Expression.Error: The import FORMAT matches no exports. Did you miss a module reference?
 
Any idea how to get past this?
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

It looks like you are trying to use DAX functions in Power Query, which uses the M language.

 

Generally, it's easier to get the month string from a date field but you can make the number into a date first:

Date.ToText(#date(2000, [MonthNumber], 1), "MMM")

(The choices of year and day in the #date are arbitrarily chosen.)

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Thank you that is it!  

 

How do I mark your post as the solution?

There should be an Accept as Solution button next to the Kudos (thumbs up) and Reply button.

AlexisOlson_0-1640188946485.png

If you don't see these options, I can also accept the solution on your behalf.

 

AlexisOlson
Super User
Super User

It looks like you are trying to use DAX functions in Power Query, which uses the M language.

 

Generally, it's easier to get the month string from a date field but you can make the number into a date first:

Date.ToText(#date(2000, [MonthNumber], 1), "MMM")

(The choices of year and day in the #date are arbitrarily chosen.)

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.

Top Solution Authors
Top Kudoed Authors