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
clara_magalhaes
New Member

FORMAT a date: error in result

Hello everyone!

 

I have a "calendar table" in my Power BI file, which was built with this command:

 

Calendario = calendar ( date (2015,01,01), today() ).

 

This returns me a table with a list of all dates between 01/01/2015 and today.

 

Later on, I began creating the other columns of the calendar table, getting the year of the date ( YEAR ('Calendario'[Date]) ), the quarter of the date ( QUARTER ('Calendario'[Date]) ), and the month of the date ( MONTH('Calendario'[Date]) ).

 

It worked well, as you can see in the image below (Please be aware that in my example, the columns are using the names in Portuguese for year (Ano), Quarter (Trimestre) and Month (Mes)):

 

ok.jpg

 

BUT, when I try to use the FORMAT command, Power BI is returning the wrong answer.

I am using FORMAT ( 'Calendario'[Mes], "mmm" ), using the columns that I have just created, but I have tried using

FORMAT ( MONTH('Calendario'[Date]), "mmm" ), referencing the date again. They al give me the same answer, as you can see below:

 

nok.jpg

 

Any clues on what is going on? Am I doing something wrong?

1 ACCEPTED SOLUTION
Migasuke
Super User
Super User

Hi @clara_magalhaes ,

Could you share your file, at least with the calendar table?

Try to use FORMAT ( MONTH('Calendario'[Date]), "MMM" ) instead and maybe check all Local and Region settings.



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

View solution in original post

2 REPLIES 2
clara_pr104518
New Member

Hello Migasuke! I was having trouble logging in with my previous account.

This format: FORMAT ( 'Calendario'[Date], "mmm" ) worked well, finally. Apparently I should use a whole date to format, not just the month.

 

Thank you anyway!

Migasuke
Super User
Super User

Hi @clara_magalhaes ,

Could you share your file, at least with the calendar table?

Try to use FORMAT ( MONTH('Calendario'[Date]), "MMM" ) instead and maybe check all Local and Region settings.



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

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.