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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ssvr
Helper III
Helper III

DAX

I want to create a measure;

Fetch the Month name from Date column

1 ACCEPTED SOLUTION
danextian
Super User
Super User

You can try this
MonthName=
VAR Date_= SELECTEDVALUE(Table[DateColumn])
RETURN FORMAT(Date_, "mmmm")

Note: this returns a value if there is only one date in the current filter context.

If this isn't what your desired result, please provide a sample date and your expected result.




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

7 REPLIES 7
ssvr
Helper III
Helper III

I Connected the SAP-Cube to Power BI.

In this senario New Column is Disabled and there is only (New Measure) i can created.

 

So, In this senario Please suggest me the DAX for below requirements:

 

- Get the Month Name from #Date column

- Diffarence between two #Dates ( = ReleaseDt - OpenDt)

 

Thanks.

Pavlous
Advocate II
Advocate II

Hi @ssvr,

you can try this function

New column = SWITCH(Month(date column),1,"January",2,"February",...)
danextian
Super User
Super User

You can try this
MonthName=
VAR Date_= SELECTEDVALUE(Table[DateColumn])
RETURN FORMAT(Date_, "mmmm")

Note: this returns a value if there is only one date in the current filter context.

If this isn't what your desired result, please provide a sample date and your expected result.




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian ,

 

Can you help me out with this query

 

One of my mate share dis DAX (Measure) for date diffarece. But i got some errors with query can you fix this

[ClosedDt-CreatedDt]

 

Daydiff = VAR Created = MAX('Dates'[CreatedDt])
VAR Closed = MAX('Dates'[ClosedDt])
VAR dd=-1
IF (Closed>Created) {
dd=DATEDIFF(Created;Closed;days)
} else {
dd= DATEDIFF(Closed;Created;days)
}
RETURN dd

I need to create only Measure not Column

 

 

Diff.JPGAgening between two dates = Closeddt - Releasedt

You may try the  formula I posted as a measure.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

May be you are right. But my case is:

 

I Connected the SAP-Cube to Power BI.

In this senario New Column is Disabled and there is only (New Measure) i can created.

 

So, In this senario Please suggest me the DAX for below requirements:

 

- Get the Month Name from #Date column

- Diffarence between two #Dates ( = ReleaseDt - OpenDt)

 

Thanks.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.