Forum Discussion
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)):
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:
Any clues on what is going on? Am I doing something wrong?
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.
2 Replies
- Migasuke
Memorable Member
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. - clara_pr104518New 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!