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

Fabric certifications survey

Certification feedback opportunity for the community.

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.