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
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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.