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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Chriswyy
Frequent Visitor

DAX to get Month() and format() as "MMMM"

Dear guys,

 

I just started to learn Power BI and try to make a calendar table using DAX.

Everything is fine at the beginning, however when I try to format the month as "MMMM", it returns only December and January.

 

Anything wrong with my DAX input ??

 

Calendar().pngMonth().png

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Chriswyy 

Try it like this.

Month_MMM = FORMAT([Date],"MMMM")

 

View solution in original post

5 REPLIES 5
jdbuchanan71
Super User
Super User

Are there maybe spaces on the end of the ones that are not returning a value? Instead of "30 days" it is "30 days "?

Add a column that is just the LEN.  They should all be 7.

 

Length = LEN ( Coursera__Inventory[RestockingFrequency] )

 

jdbuchanan71
Super User
Super User

Just read the days at the beginning of the sring and add that to the LastRestocked like this.

 

Next Restock = 
VAR _Days = LEFT (
            Coursera__Inventory[RestockingFrequency],
            FIND ( " ", Coursera__Inventory[RestockingFrequency] ) - 1
        )
RETURN 
CONVERT ( Coursera__Inventory[LastRestocked] + _Days, DATETIME )

jdbuchanan71_0-1693536994762.png

 

 

I can understand the way of your doing, but whats wrong with my input ??

I wanna explore as much DAX as possible, because i'm current learning.

 

Based on the nested ifs, by right the DAX should return me a value for each row,

but why some rows are NULL, even if the logical test is True

Chriswyy
Frequent Visitor

@jdbuchanan71 

Sry, I have another question again. Also about date.

Something wrong with my nested if ??

 

Dateadd().png

 

 

jdbuchanan71
Super User
Super User

@Chriswyy 

Try it like this.

Month_MMM = FORMAT([Date],"MMMM")

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.