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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.