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
SEMattis
Advocate II
Advocate II

[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
Wellington1981
Frequent Visitor

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.

Wellington1981
Frequent Visitor

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
Super User
Super User

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 II
Advocate II

And perhaps even more worrying? 

SEMattis_1-1707921693337.png

 

 

_AAndrade
Super User
Super User

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
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.