Fabric DW currently supports the EOMONTH() function, which returns the last day of a given month. However, it does not provide a built-in function that can return the last day of a week, quarter, or year in addition to the month.
Calculating the last day of a week, quarter, or year requires custom expressions using combinations of DATEADD, DATEDIFF, and calendar logic. This adds complexity and reduces readability in time-based reporting and analytics.
The LAST_DAY() function is supported in several other databases Snowflake, MySQL, Oracle, and makes calculating the last dat in interval much easier:
LAST_DAY('2025-08-18', 'MONTH') -- → 2025-08-31
LAST_DAY('2025-08-18', 'QUARTER') -- → 2025-09-30
LAST_DAY('2025-08-18', 'YEAR') -- → 2025-12-31
LAST_DAY('2025-08-18', 'WEEK') -- → 2025-08-23
The equivalent expressions in Fabric DW are:
SELECT EOMONTH(DATEADD(QUARTER, DATEDIFF(QUARTER, 0, '2025-08-18'), 0)) AS LastDayOfQuarter;
SELECT EOMONTH(DATEFROMPARTS(YEAR('2025-08-18'), 12, 1)) AS LastDayOfYear;
SELECT DATEADD(DAY, 7 - DATEPART(WEEKDAY, '2025-08-18'), '2025-08-18') AS LastDayOfWeek;
3 Comments
- DrsqlNew MemberNice function idea. Do first_day as well. And it must honor a first day of the week setting as well. If you could set custom ranges it becomes worth its weight in gold, but the date table needs a job still I guess.
- Shahid12523Community ChampionIn Fabric DW, EOMONTH() works only for month-end. For other intervals, you need custom expressions: Week: DATEADD(DAY, 7 - DATEPART(WEEKDAY, date), date) Quarter: EOMONTH(DATEADD(QUARTER, DATEDIFF(QUARTER, 0, date), 0)) Year: EOMONTH(DATEFROMPARTS(YEAR(date), 12, 1))
- TwinkleCyrilMicrosoft EmployeeThanks for the feedback. We have added this feature to our backlog.
Recent ideas
Support Git-Integrated Files in Fabric Workspaces
Overview Allow users to store and manage arbitrary files such as .md, .sql, .py, and .yml directly in a Fabric workspace, with built-in Git integration. Value This would keep documentation, SQL sc...ryomaru08253 hours agoAdvocate INew27Views4likes1CommentConsistent Locale Handling Across Power BI, Fabric, PowerPoint, and Subscriptions
Microsoft Fabric and Power BI should provide consistent locale handling across all user experiences. Today, locales such as German (Switzerland) are correctly respected in Power BI Desktop and the Po...Le_M5 hours agoRegular VisitorNew19Views1like0CommentsIn Data Pipelines, Schedules should not be part of the definition
The request is to ensure Schedules are not included in the definition of a Data Pipeline for purposes of Deployment Pipelines. Today, when we deploy content across environments, the item frequent...schneiw6 hours agoAdvocate IVUnder Review813Views25likes3CommentsPipeline activity Refresh SQL Endpoint (preview) does not accept dynamic content
I am testing out the new Pipeline activity for Refresh SQL Endpoint, currently in preview. Sure, I get it that this is in preview, but it should at least have basic minimum functionality. It do...ToddChitt6 hours agoSuper UserNew590Views8likes6CommentsPower BI Admin & Governance Center – Centralized Activity and Usage Analytics
Subject: Feature Proposal: Advanced Power BI Admin & Governance Center – Centralized Activity, Access, Sharing, Licensing and Usage Analytics Dear Microsoft Power BI Team, I would like to propose a...Dr7awb10 hours agoNew MemberNew7Views0likes0Comments