Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
SEMattis
Advocate III
Advocate III

[DAX] Format function returning wrong month and date?

Hi,

 

So I have a problem with the formatting function which could be error 45 (I.e. yours truly) or something really interesting is happening in Power BI. When using the following syntax:


VAR Prev_M = MONTH((TODAY())) -
 
It returns 1. However when setting the variable in the FORMAT function and converting the date to a month name the measure returns "December" (See images below).
SEMattis_0-1707916853333.pngSEMattis_1-1707916890633.png

Need some help 😄

13 REPLIES 13
Anonymous
Not applicable

Hi @SEMattis 

How about  FORMAT(TODAY(),"MMM") ? Perhaps MOTH function is messing up something .
Thanks !

Well this would not work since I am dependent on months in the past to solve my problem. Good idea though.

Anonymous
Not applicable

I'am having the same problem. It is terrible.

 

Open a new ticket with your problem and I will take a look





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




_AAndrade
Resident Rockstar
Resident Rockstar

Tell me what you want to show on the visual and I will give you the correct dax function.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




So I want the FORMAT function to return "December" rather than January

SEMattis
Advocate III
Advocate III

And perhaps even more worrying? 

SEMattis_1-1707921693337.png

 

 

_AAndrade
Resident Rockstar
Resident Rockstar

The problem is in you dax formula. You put 

_AAndrade_0-1707920788961.png

And you must put -1 inside parantesis. like this:

_AAndrade_1-1707920832449.png

 



 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




@_AAndrade. Unfortunately, it is still not working

 

SEMattis_0-1707921227198.png

 

Please try this formula:

_AAndrade_0-1707923273388.png


I think it's what you're looking for.

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




@SEMattis please let me know if your problem was solved.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Sorry but I have tried this too without success

Please send me a picture with the output that you're looking for, because I don't understand yet what are the problem





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors