Courseiva
Prepare the datamediumMultiple ChoiceObjective-mapped

PL-300 Prepare the data Practice Question

You are building a Power BI data model from an Azure SQL Database. The source table contains a column 'OrderDate' of type datetime. You want to create a date table in Power Query that includes all dates from the minimum to maximum OrderDate. Which M function should you use to generate the list of dates?

⚠ Common exam trap

Watch out — candidates often confuse `List.DateTimes` (which includes time) with `List.Dates` (date only), or they overcomplicate the solution by choosing `List.Generate` when a simpler, purpose-built function exists.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

List.Dates

`List.Dates` generates a list of sequential dates (type `date`) given a start date, a count of values, and a step duration. In Power Query, when you need a date table covering the range from the minimum to maximum `OrderDate`, you compute the count as `Duration.Days(MaxDate - MinDate) + 1` and use `List.Dates(MinDate, Count, #duration(1,0,0,0))`. This produces a clean list of dates without time components, ideal for a date dimension.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • List.Dates

    Why this is correct

    List.Dates is the correct M function because it is specifically designed to generate a sequential list of date values. Its signature, List.Dates(start as date, count as number, step as duration), creates a contiguous series by incrementing the start date by the provided duration each time. For example, List.Dates(#date(2020,1,1), 366, #duration(1,0,0,0)) returns a list of all 366 days in 2020, which can then be converted directly into a date dimension table. This makes it the most direct, readable, and type-appropriate choice for this requirement.

  • List.Generate

    Why it's wrong here

    List.Generate is a powerful, general-purpose function for creating lists based on an initial value, a condition, and a next function. While it *could* be used to construct a list of dates, it requires manually defining the start date, the increment logic (adding one day), and the termination condition. It fails this scenario because it is not the specialised M function designed for generating a sequence of dates. The function is tempting because it can generate any list iteratively, making it suitable for complex sequences like Fibonacci numbers or custom recursive calculations where a dedicated `List.` function does not exist.

  • List.DateTimes

    Why it's wrong here

    List.DateTimes is incorrect for this requirement because it produces a list of datetime values, not date-only values. The function's result includes the time component from the start parameter; for instance, List.DateTimes(#datetime(2020,1,1,0,0,0), 10, #duration(1,0,0,0)) yields values like 2020-01-01T00:00:00 and 2020-01-02T00:00:00, carrying a time portion that is not needed in a pure date dimension. Although you could pass a start value and later apply Date.From to strip the time, that adds an unnecessary transformation stage and means you are using a function whose output type does not match the intended model. The specialised function for generating a list of dates is List.Dates, not List.DateTimes.

  • List.Range

    Why it's wrong here

    List.Range has a fundamentally different purpose: it extracts a contiguous sublist from an existing list, so its first argument must be an existing list of values. For example, List.Range({1..10}, 3, 4) returns {4,5,6,7}, a slice of the original list, and it cannot synthesise new date values on its own. In this scenario, there is no pre-existing list of dates to slice; you are starting from scratch and need to generate a calendar sequence. Therefore, List.Range fails because it is a subsetting function, not a generator, and it does nothing to produce the required list of consecutive dates.

About these practice questions

This PL-300 question is part of Courseiva's 217-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PL-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PL-300 exam.