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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Leigh_123
Frequent Visitor

Round Calculated Date to Start of month

Hello,

 

I have a standard CalendarAuto table linked with my data set. I am trying to get a "previous period" card set up using the following code:

 

Start Previous Period = 
Dates[End Previous Period]-Dates[Days in Period]

 

I need to then round this start date to the begining of the month, ie if the return is 3 may, i need the return to be 1 may. Is there any way to do this? I tried using STARTOFMONTH however it does not allow me to do this as the calculation is not a column.

 

Thank you in advance

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

use the EOMONTH(dateValue, -1) + 1
That EOMONTH will return the last day of the previous month, and then you can +1 to get the 1st day of the original dateValue

View solution in original post

2 REPLIES 2
vicky_
Super User
Super User

use the EOMONTH(dateValue, -1) + 1
That EOMONTH will return the last day of the previous month, and then you can +1 to get the 1st day of the original dateValue

Thank you, this is exactly what i was looking for! much appreciated.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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