Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I want to create a custom date column with displays 15th of every month and the end of the month based on a date column.
Any day less than or equal to 15th should display 15th and any day less than or equal to the End of the month should display end of month.
For example-->
Given Date Output Date
10/9/2022 10/15/2022
10/11/2022 10/15/2022
10/17/2022 10/31/2022
10/20/2022 10/31/2022
11/7/2022 11/15/2022
11/17/2022 11/30/2022
Solved! Go to Solution.
You can add a custom column with this logic:
if Date.Day([Given Date]) <= 15
then Date.AddDays([Given Date], 15-Date.Day([Given Date]))
else Date.EndOfMonth([Given Date])
You can use this formula in a custom column in the query editor to get your result.
= if Date.Day([Given Date]) <= 15 then #date(Date.Year([Given Date]), Date.Month([Given Date]), 15) else Date.EndOfMonth([Given Date])
Pat
You can add a custom column with this logic:
if Date.Day([Given Date]) <= 15
then Date.AddDays([Given Date], 15-Date.Day([Given Date]))
else Date.EndOfMonth([Given Date])
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |