nerdexam
Microsoft

DP-600 · Question #156

You have a query in Microsoft Power BI Desktop that contains two columns named Order_Date and Shipping_Date. You need to create a column that will calculate the number of days between Order_Date and…

The correct answer is B. Duration.Days. To calculate the number of days between two date columns in Power Query, first subtract the earlier date from the later date to get a duration, then use Duration.Days to extract the day component.

Submitted by klara.se· Apr 18, 2026Prepare data

Question

You have a query in Microsoft Power BI Desktop that contains two columns named Order_Date and Shipping_Date. You need to create a column that will calculate the number of days between Order_Date and Shipping_Date for each row. Which Power Query function should you use?

Options

  • ADateTime.LocalNow
  • BDuration.Days
  • CDuration.From
  • DDate.AddDays

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    94% (32)
  • C
    3% (1)

Why each option

To calculate the number of days between two date columns in Power Query, first subtract the earlier date from the later date to get a duration, then use `Duration.Days` to extract the day component.

ADateTime.LocalNow

`DateTime.LocalNow` returns the current local date and time and is not used for calculating the difference or duration between two existing date columns.

BDuration.DaysCorrect

The `Duration.Days` function is used to extract the number of whole days from a `duration` value, which can be obtained by subtracting `Order_Date` from `Shipping_Date` to determine the exact number of days between them.

CDuration.From

`Duration.From` converts a number, text, or list into a duration value, but it is not directly used to calculate the difference between two date/datetime columns.

DDate.AddDays

`Date.AddDays` adds a specified number of days to a given date and is used for shifting dates, not for calculating the difference or duration between two dates.

Concept tested: Power Query duration functions

Source: https://learn.microsoft.com/en-us/powerquery-m/duration-days

Topics

#Power Query M#Date calculations#Duration functions#Calculated columns

Community Discussion

No community discussion yet for this question.

Full DP-600 Practice