DAX Date and Time Functions in Power BI: The Complete Guide
- DAX date and time functions let you pull apart a date (year, month, day, quarter), measure the gap between two dates, or shift a date forward and backward in time.
TODAY()andNOW()always reflect the current date and time when your report refreshes, which makes them the backbone of almost every "days until deadline" or "is this overdue" calculation.DATEDIFFandYEARFRACboth measure the distance between two dates, but they answer different questions — one counts whole interval boundaries crossed, the other returns a fractional number of years.EDATEandEOMONTHboth shift a date by a number of months, butEDATEkeeps the same day of the month whileEOMONTHalways lands on the last day of whatever month you land on.- Every function below is demonstrated against the same small Projects table, so you can watch how the same five start and end dates produce a different answer depending on which function is doing the asking.
Dates look simple until you actually have to calculate something with them. "How many days between these two dates" sounds like basic subtraction, right up until you hit a month boundary, a weekend, or a leap year, and the obvious answer turns out to be wrong. DAX has a function for almost every one of these situations — the trick is knowing which one actually matches the question you're asking. This guide goes through all of them.
What This Group of Functions Actually Does
Broadly, DAX's date and time functions fall into four jobs: pulling a single piece of information out of a date (the year, the month, the day of the week), measuring the distance between two dates, shifting a date forward or backward, and grabbing the current date or time live. None of these are especially hard on their own. Where people get tripped up is mixing them up — reaching for DATEDIFF when EDATE was actually the right tool, or assuming WEEKNUM counts weeks the same way a calendar app does.
A quick note before diving in: in most real Power BI models, you'd typically be working with a proper Calendar table built using CALENDAR or CALENDARAUTO, and most date logic happens against that table rather than scattered raw date columns. We'll get to both of those. But first, let's build up the individual functions one at a time, since they're the building blocks everything else relies on.
The Sample Data Used Throughout This Guide
Every example below uses the same small Projects table — five projects, each with a start date and an end date. Keep an eye on Website Revamp, which runs from January 15, 2026 to March 10, 2026 — most single-date examples pull from its start date specifically, so you can watch the same date get pulled apart in different ways.
| ProjectID | ProjectName | StartDate | EndDate |
|---|---|---|---|
| 1 | Website Revamp | Jan 15, 2026 | Mar 10, 2026 |
| 2 | Inventory Audit | Feb 10, 2026 | Feb 28, 2026 |
| 3 | Client Onboarding | Mar 1, 2026 | Mar 15, 2026 |
| 4 | Server Migration | Mar 20, 2026 | Apr 2, 2026 |
| 5 | Q3 Marketing Push | Apr 5, 2026 | May 30, 2026 |
DATE, DATEVALUE, TIME, and TIMEVALUE: Building Dates From Scratch
These four functions all do the same basic job — they take pieces that aren't yet a proper date or time, and assemble them into one.
DATE builds a date from three separate numbers: year, month, and day.
Sample Date = DATE(2026, 1, 15)
This returns January 15, 2026 as an actual date value, not text. You'll see this constantly inside other functions, since plenty of DAX formulas need a specific date typed in by hand, and DATE is the safe way to do that rather than typing a date as plain text (which DAX can sometimes misread depending on regional date formats).
DATEVALUE does almost the same job, but starting from a text string instead of three separate numbers.
Converted Date = DATEVALUE("2026-01-15")
This is what you reach for when a date arrived in your model as text — maybe from a CSV import — and needs to become a real date before any date math will work on it.
TIME and TIMEVALUE follow the identical pattern, just for time instead of date. TIME builds a time from hour, minute, and second numbers:
Sample Time = TIME(14, 30, 0)
This returns 2:30 PM as a proper time value. TIMEVALUE converts a text string like "2:30 PM" into that same kind of usable time value, exactly the way DATEVALUE does for dates.
YEAR, MONTH, DAY, QUARTER, and WEEKDAY: Pulling a Date Apart
Once you have a real date, these functions let you extract a single piece of it. They're some of the most frequently used functions on this entire list, since report filters and groupings are constantly built around "show me data by year" or "by quarter."
Using Website Revamp's start date, January 15, 2026:
Start Year = YEAR(Projects[StartDate]) → 2026
Start Month = MONTH(Projects[StartDate]) → 1
Start Day = DAY(Projects[StartDate]) → 15
YEAR, MONTH, and DAY are about as direct as DAX gets — each one just returns the matching number from the date you feed it.
QUARTER isn't actually a separate stored value on a date — it's calculated from the month. January, February, and March all fall in quarter 1; April through June fall in quarter 2, and so on.
Start Quarter = QUARTER(Projects[StartDate]) → 1
January 15 lands in Q1, which makes sense since January is the first month of the standard calendar year.
WEEKDAY returns which day of the week a date falls on, as a number rather than a name. By default, it numbers Sunday as 1 through Saturday as 7 (you can change this with an optional second argument if your week starts on a Monday instead).
Start Weekday = WEEKDAY(Projects[StartDate]) → 5
January 15, 2026 falls on a Thursday, and under the default numbering scheme (Sunday = 1), Thursday comes out to 5. This is the kind of function that's easy to get a "technically correct but visually confusing" result from, if you forget which day your numbering starts on — worth double-checking the default before you build a filter around it.
WEEKNUM: A Function That Trips People Up More Than It Should
WEEKNUM returns which week of the year a date falls in, numbered from the start of that year. It sounds simple, but it catches people off guard because there isn't one universal definition of "week 1" — different systems disagree on whether weeks start on Sunday or Monday, and on how the first partial week of January gets counted.
Start Week Number = WEEKNUM(Projects[StartDate]) → 3
Under DAX's default counting system (which starts weeks on Sunday), January 15, 2026 falls in week 3 of the year. If you compared this to a different counting system — like the ISO week numbering used in many European business contexts, which starts weeks on Monday and has its own rule for week 1 — you could get a slightly different number for the same date. If your WEEKNUM results ever look off by one compared to what a colleague calculated elsewhere, this mismatch in week-numbering systems is almost always the reason, not a bug in your formula.
HOUR, MINUTE, and SECOND: Pulling a Time Apart
These three do for time values exactly what YEAR, MONTH, and DAY do for dates — they extract one specific piece.
Sample Hour = HOUR(TIME(14, 30, 45)) → 14
Sample Minute = MINUTE(TIME(14, 30, 45)) → 30
Sample Second = SECOND(TIME(14, 30, 45)) → 45
Given a time of 2:30:45 PM, HOUR returns 14 (since DAX works internally in 24-hour format), MINUTE returns 30, and SECOND returns 45. You'll use these far less often than the date-breakdown functions above, since most business reporting cares about which day something happened far more than which exact second — but they matter for anything tracking precise timestamps, like system logs or sensor data.
TODAY, NOW, UTCNOW, and UTCTODAY: What Time Is It Right Now
These four are different from everything above, because they don't take any date as an input at all — they look at the clock the moment your report calculates, and return whatever the current date or time happens to be.
TODAY() returns the current date, with no time component.
Days Until Deadline = Projects[EndDate] - TODAY()
This is genuinely one of the most useful single functions in this entire guide. Subtracting TODAY() from a deadline date gives you a constantly self-updating "days remaining" calculation — open the report tomorrow, and the number has automatically shifted by one, with zero manual updates required.
NOW() returns the current date and time together, down to the second.
Current Timestamp = NOW()
Use this when you need to know not just what day it is, but the exact moment — for example, timestamping when a report was last refreshed.
UTCNOW() and UTCTODAY() return the same kind of information as NOW() and TODAY(), but in Coordinated Universal Time (UTC) rather than your local time zone. These matter most when your data spans multiple regions or time zones, and you need one consistent, unambiguous reference point that doesn't shift depending on where the report happens to be opened.
DATEDIFF: Measuring the Gap Between Two Dates, Properly
DATEDIFF returns the number of complete interval boundaries crossed between two dates — and that specific phrasing matters more than it might seem, because it's not quite the same as "how many days, weeks, or months apart are these dates" in the way you might first assume.
DATEDIFF(Projects[StartDate], Projects[EndDate], DAY)
For Website Revamp (January 15 to March 10, 2026), this returns 54 — that part matches simple subtraction, since counting days really is just counting days.
But watch what happens with a different interval:
DATEDIFF(Projects[StartDate], Projects[EndDate], MONTH) → 2
DATEDIFF(Projects[StartDate], Projects[EndDate], WEEK) → 8
DATEDIFF(Projects[StartDate], Projects[EndDate], QUARTER) → 0
The MONTH result is 2, because the project crosses two calendar-month boundaries — from January into February, and from February into March — regardless of how many actual days are in each of those months. The QUARTER result is 0, because both January 15 and March 10 fall inside the same quarter (Q1), even though there's a 54-day gap between them — DATEDIFF is counting quarter boundaries crossed, and there isn't one here. And the WEEK result comes out to 8, based on how many Sunday-to-Sunday week boundaries get crossed between the two dates — which is genuinely easy to miscalculate by hand, since it isn't simply the day count divided by seven.
The interval argument accepts SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR, and one more detail worth knowing: if the first date is later than the second, DATEDIFF returns a negative number, telling you the order is flipped rather than throwing an error.
EDATE and EOMONTH: Shifting a Date by Whole Months
These two both move a date forward or backward by a number of months, but they land in different places, and mixing them up is a genuinely common mistake.
EDATE shifts a date forward or backward by a given number of months, while trying to keep the same day of the month.
EDATE(Projects[StartDate], 2) → March 15, 2026
EDATE(Projects[StartDate], -1) → December 15, 2025
Starting from January 15, 2026, adding two months lands on March 15 — same day number, just two months later. Subtracting one month lands on December 15 of the previous year. EDATE is what you want whenever the day-of-month genuinely matters to your calculation, like "the loan payment date, three months from now."
EOMONTH shifts by months too, but it always returns the last day of whatever month it lands on, completely ignoring the original day number.
EOMONTH(Projects[StartDate], 0) → January 31, 2026
EOMONTH(Projects[StartDate], 1) → February 28, 2026
EOMONTH(Projects[StartDate], -1) → December 31, 2025
Notice that zero months forward from January 15 still returns January 31 — not January 15 — because EOMONTH isn't trying to preserve the day at all; it's specifically built to find month-end dates. This makes it the natural choice for anything based on "end of this month" or "end of last month," like calculating a billing cycle or a financial period close. Mixing up EDATE and EOMONTH is an easy trap: if you actually wanted "this same day, next month," EOMONTH will quietly give you the wrong date, since matching a specific day was never what it's built to do.
NETWORKDAYS: Counting Only the Working Days
NETWORKDAYS counts the whole workdays between two dates, automatically excluding weekends — and optionally, a list of specific holiday dates you provide.
NETWORKDAYS(Projects[StartDate], Projects[EndDate])
For Website Revamp, running from Thursday, January 15 through Tuesday, March 10, 2026, this returns 39 working days — noticeably fewer than the raw 54-day span, because every Saturday and Sunday in between gets excluded automatically. This is the function behind almost any "how many business days until this deadline" calculation, and it's significantly more useful for project and deadline tracking than a plain day count, since weekends rarely count as productive time in most business contexts.
You can also feed it a table of specific holiday dates as an optional fourth argument, and those get excluded from the count too, on top of the weekends — useful if your organization tracks public holidays and wants them reflected in working-day calculations.
YEARFRAC: Expressing a Date Gap as a Fraction of a Year
YEARFRAC calculates the fraction of a year represented by the days between two dates — instead of returning a whole number of days, weeks, or months, it returns a decimal, like 0.25 for roughly a quarter of a year.
YEARFRAC(Projects[StartDate], Projects[EndDate])
For Website Revamp's 54-day span, this comes out to roughly 0.15, meaning the project covers about 15% of a full year. This function exists primarily for financial calculations — prorating an annual fee across a partial year, or calculating partial-year interest — where you genuinely need "what fraction of a year is this," not a day count.
One detail worth knowing: YEARFRAC has an optional fourth argument controlling exactly how it counts days internally (there are a few different conventions used in finance, like assuming every month has 30 days versus counting actual calendar days). The default convention is the US 30/360 method, common in bond and loan calculations — if you've ever seen YEARFRAC give a result that doesn't quite match counting actual calendar days, this default day-counting assumption is almost always why.
CALENDAR and CALENDARAUTO: Building a Date Table
These last two are different in kind from everything else in this guide — rather than calculating something about an existing date, they generate an entirely new table made up of consecutive dates, which is the backbone of almost every well-built Power BI model.
CALENDAR generates a continuous table of dates between a start date and an end date that you specify directly.
Calendar = CALENDAR(DATE(2026,1,1), DATE(2026,12,31))
This produces one row per day for all of 2026 — January 1 through December 31 — in a brand-new table you can then build relationships to, and use for time-intelligence calculations like year-over-year comparisons.
CALENDARAUTO does the same basic job, but it figures out the date range automatically by scanning every date column already present in your model, rather than you typing in specific start and end dates yourself.
Calendar = CALENDARAUTO()
If your model's earliest date anywhere is January 15, 2026 (Website Revamp's start) and its latest is May 30, 2026 (Q3 Marketing Push's end), CALENDARAUTO would build a calendar table spanning a full year (or years) that comfortably covers that whole range, rather than just the narrow window your actual data falls into — it rounds out to complete years by default, which keeps year-over-year style calculations working cleanly even near the edges of your data.
In practice, most experienced report builders default to CALENDAR with explicit dates, since it gives you precise control over exactly what range your date table covers — but CALENDARAUTO is a genuinely convenient shortcut when you just want something reasonable in place quickly, without thinking too hard about exact boundaries.
Quick-Reference Table of All 24 Functions
| Function | What it does |
|---|---|
| DATE | Builds a date from year, month, day numbers |
| DATEVALUE | Converts text into a real date |
| TIME | Builds a time from hour, minute, second numbers |
| TIMEVALUE | Converts text into a real time |
| YEAR | Extracts the year from a date |
| MONTH | Extracts the month from a date |
| DAY | Extracts the day of the month from a date |
| QUARTER | Returns which quarter (1–4) a date falls in |
| WEEKDAY | Returns the day of the week as a number |
| WEEKNUM | Returns the week number of the year |
| HOUR | Extracts the hour from a time |
| MINUTE | Extracts the minute from a time |
| SECOND | Extracts the second from a time |
| TODAY | Returns the current date |
| NOW | Returns the current date and time |
| UTCNOW | Returns the current UTC date and time |
| UTCTODAY | Returns the current UTC date |
| DATEDIFF | Counts interval boundaries crossed between two dates |
| EDATE | Shifts a date by whole months, keeping the day |
| EOMONTH | Shifts to the last day of a month, N months away |
| NETWORKDAYS | Counts working days between two dates |
| YEARFRAC | Returns the gap between two dates as a fraction of a year |
| CALENDAR | Builds a date table between two specified dates |
| CALENDARAUTO | Builds a date table automatically from your model's data |
Common Mistakes With Date Functions
- Confusing
EDATEandEOMONTH. If you need the same day-of-month, shifted by some number of months, that'sEDATE. If you need the actual last day of a month, that'sEOMONTH— and it will ignore your original day number entirely, every time. - Assuming
DATEDIFFwithWEEKorMONTHworks like simple division. It doesn't divide the day count by 7 or 30 — it counts actual calendar boundaries crossed, which can produce a result that looks slightly different from what straightforward math would suggest. - Forgetting that
WEEKNUMisn't universal. Different systems number the first week of the year differently. If your number looks off by one compared to another tool or colleague, a mismatched week-numbering convention is almost always the cause. - Using plain day-count subtraction when you actually meant business days. A simple
EndDate - StartDateincludes weekends. If the real question is about working days,NETWORKDAYSis the function that actually answers it.
Recommended Next Guides & Deep Dives
Continue expanding your Power BI and Fabric architecture knowledge with these closely connected tutorials:
-
How to Build a Dynamic Date Table in DAX
→
The definitive foundation required before applying date and time functions.
-
What Is DAX: Fiscal Year & Current Month Formulas
→
Handle non-standard financial calendars and current-period KPI offsets.
-
CALCULATE in DAX: 5 Real-World Examples
→
Combine date logic with SAMEPERIODLASTYEAR and DATEADD.
-
DAX Aggregation Functions in Power BI
→
Aggregate date-filtered metrics across dimensions efficiently.
-
DAX Cheat Sheet: 50 Functions Every User Should Know
→
Quick syntax lookups for time intelligence and date functions.
Step-by-Step Implementation Sandbox
1. Determine the date range and calendar layout
Determine if you need a static calendar via CALENDAR or a dynamic range based on data model via CALENDARAUTO.
2. Write your DAX expression
Open Power BI desktop, create a New Calculated Table, and define your Date table or measures using the built-in DAX functions.
Frequently Asked Questions
What's the difference between TODAY() and NOW() in DAX?
TODAY() returns just the current date, with no time attached. NOW() returns the current date and time together, down to the second. Use TODAY() for day-level calculations like 'days until deadline,' and NOW() when the exact time matters, like a refresh timestamp.
What's the difference between EDATE and EOMONTH?
EDATE shifts a date by a number of months while keeping the same day of the month. EOMONTH shifts by months too, but always lands on the last day of that resulting month, regardless of the original day.
Why does DATEDIFF give a different answer than I expected?
DATEDIFF counts whole interval boundaries crossed — calendar months, quarters, or weeks — rather than dividing a day count. Two dates that are 54 days apart might cross only 2 month boundaries, or 0 quarter boundaries, depending on exactly where they fall on the calendar.
Should I use CALENDAR or CALENDARAUTO to build a date table?
CALENDAR is better when you want precise, manually specified control over the exact start and end dates of your table. CALENDARAUTO is a faster shortcut that scans your existing model and builds a reasonable date range automatically, rounded to full years.
What's the difference between NETWORKDAYS and a plain date subtraction?
Plain subtraction counts every single day, including weekends. NETWORKDAYS counts only working days, excluding weekends automatically, and optionally excluding specific holiday dates you provide.
Why is my WEEKNUM result different from what I expected?
WEEKNUM has multiple possible counting systems, differing mainly in which day a week starts on and how the first partial week of January is handled. The default DAX behavior may not match ISO week numbering or other regional conventions, which is the most common reason for a one-off mismatch.