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
Raj007
Helper III
Helper III

how do i get the begining of the month from this max date...

Hi All,

Thanks for your time. I have a calculated column in power BI file and i am trying to get the start of the month or the begining of the month from the max date ...

my calculated column in the data view
vLast_3_Months=    EDATE(DATEVALUE(MAX(MyDataSet[UpdatedDate])),-3)

my max date returned is 01/09/2022 - Jan 9th 2022 - most of the time it will be every day's date unless if there is no data it might be the previous date or the date that has the date for ex: if jan 9 2022 has no data then it might be Jan 8 2022 -99% of the time we get every day data

but the above calculated column is giving me October 9 2021 as the last 3 months value but I want the October 1 2021 instead

i tried to wrap the above with startofmonth( )  - but this is giving me an error
any help please

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Raj007 

Try it like this.

 

vLast_3_Months =
	VAR _DateValue = EDATE ( DATEVALUE ( MAX ( MyDataSet[UpdatedDate] ) ), -3 )
RETURN 
	DATE ( YEAR ( _DateValue ), MONTH ( _DateValue ), 1 )

 

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

@Raj007 

Try it like this.

 

vLast_3_Months =
	VAR _DateValue = EDATE ( DATEVALUE ( MAX ( MyDataSet[UpdatedDate] ) ), -3 )
RETURN 
	DATE ( YEAR ( _DateValue ), MONTH ( _DateValue ), 1 )

 

Alternatively,

vLast_3_Months = EOMONTH ( DATEVALUE ( MAX ( MyDataSet[UpdatedDate] ) ), -4 ) + 1

Hi Jdbuchanan, thank you so much, good idea

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!

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.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.