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
AMR80
Frequent Visitor

First Day of the Month and Current Year

I need to find the first day of the month from the month an employee started, but use the current year. 

 

I'm trying to do this with a Measure in PBI desktop. 

 

I tried the below measure formula, but it doesn't recognize the "Month" portion of the formula: 

AMR80_0-1620661365230.png

AMR80_1-1620661385246.png

 

The [Start Date] field is a Date field: 

AMR80_2-1620661562003.png

 

Here's the measure formula:
Personal Hours Reset Date = DATE(Year(TODAY()),'Employee Time Used - Hours'[Start Date],STARTOFMONTH('Employee Time Used - Hours'[Start Date])
1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @AMR80 

 

 Try the below formula:

 

Start of Current year Month = DATE(
                                                          YEAR(TODAY()),
                                                          MONTH(MIN('Date Sample'[given_date])),
                                                          1)
 
Thanks
Raj

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

HI @AMR80 

 

 Try the below formula:

 

Start of Current year Month = DATE(
                                                          YEAR(TODAY()),
                                                          MONTH(MIN('Date Sample'[given_date])),
                                                          1)
 
Thanks
Raj

That did it @Anonymous !! Thank you very much

Anonymous
Not applicable

Hell0 @AMR80 ,

try with below measure,

Measure = DATE(YEAR(TODAY()),MONTH(MAX(Table[date])),DAY(STARTOFMONTH(Table[date])))

That got me much closer thank you! The only issue now is the DAY. It returned 3/5/2021 instead of 3/1/2021. The actual Start Date in the Start Date field is 3/19/2018. Here is what your formula returned in PBI: 

AMR80_1-1620675351355.png

 

 

 

HotChilli
Super User
Super User

You need to pass a number between 1 and 12 for the month parameter. You're trying to pass a date there.

Also, a measure is evaluated in context so if using a field from the data it has to have an aggregation round it (MIN, MAX etc) .  So please be aware whent constructing the measure.

Thank you @HotChilli but I still cannot get it to work. Can you suggest a measure formula that would take this date (for example): 3/9/2018 and return: 3/1/2021 (the first of the month from the original date and the current year). 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.