cancel
Showing results for
Did you mean:
Continued Contributor

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):

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
Super User

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

5 REPLIES 5
Super User

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

Super User

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

Continued Contributor

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

Super User

Hi:

NP.

Begin Next Month =
VAR currdate = Dates[Date]
return
EOMONTH(currdate,0)+1

If it works well, please accept as solution. Thanks!
Continued Contributor

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

Announcements

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors