- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If statement with date
I have linked to our new maintenance system in PowerBi. I am trying to automate the machine downtime metric. In the calculation date field, I have an IF statement that says
I have a field [created.on]. I need a statement that says if [created.on] is before the current month, return the first date of the current month, if not return [created.on]. The reason for this is that downtime is measured by a monthly metric. So as the work order was started on 11/26, the downtime from 11/26-11/30 would be counted on the November downtime report.
Please let me know if anything is not clear. Any help would be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try the following formula:
Start Date =
var startOfThisMonth = EOMONTH(TODAY(), -1) + 1
return IF('Table'[created_at] < startOfThisMonth, startOfThisMonth, 'Table'[created_at])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try the following formula:
Start Date =
var startOfThisMonth = EOMONTH(TODAY(), -1) + 1
return IF('Table'[created_at] < startOfThisMonth, startOfThisMonth, 'Table'[created_at])

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
05-28-2024 09:26 AM | |||
08-26-2024 04:48 PM | |||
03-29-2024 01:14 PM | |||
08-08-2024 08:20 AM | |||
09-09-2024 10:49 PM |
User | Count |
---|---|
24 | |
13 | |
10 | |
10 | |
8 |
User | Count |
---|---|
16 | |
15 | |
13 | |
12 | |
10 |