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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JustinDoh1
Post Prodigy
Post Prodigy

How to express Next Month First Day, Prev. Month First Day etc. (Time intelligence question)

Hi Community,

 

I am trying to write DAX on following examples (as shown below):

JustinDoh1_0-1645208438429.png

 

Based on value of "Date" (like 02/20/2021, 01/10/2021), I would like to create column value like "Next Month First Day", "Current Month First Day", "2 Month..", "4 Month.." etc.

I think creating Column is what I needed now, but if there is a way to create Measure, I will use later.

 

Thanks.

 

 

 

 

 

1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hi:

If your matrix has month as column, then this would work as a measure:

Next Month First Day =
VAR dayone = CALCULATE(Max(Dates[Date]))
return
CALCULATE(dayone, DATEADD(Dates[Date],1,MONTH))+1

 

View solution in original post

5 REPLIES 5
Whitewater100
Solution Sage
Solution Sage

Hi Justin:

Anoter variation you might like is:

=NEXTDAY(LASTDATE(Dates[Date]))

It's less code and works if you are set up by month. Just FYI. Bill

Whitewater100
Solution Sage
Solution Sage

Hi:

If your matrix has month as column, then this would work as a measure:

Next Month First Day =
VAR dayone = CALCULATE(Max(Dates[Date]))
return
CALCULATE(dayone, DATEADD(Dates[Date],1,MONTH))+1

 

@Whitewater100 

Thank you so much! How do we express in Column by chance?

Hi:

NP. 

Begin Next Month =
VAR currdate = Dates[Date]
return
EOMONTH(currdate,0)+1
 
If it works well, please accept as solution. Thanks!

I got this now in column:
Current Month First Day1 = EOMONTH(CALENDAR[Date] ,-1)+1

2 Month Ago First Day1 = EOMONTH(CALENDAR[Date] ,-3)+1

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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