PL-300 · Question #395
You use Power Query Editor to preview a column named Date as shown in the following exhibit. You need to change the Date column to contain only the year. The solution must minimize administrative…
The correct answer is D. Transform the column to contain only the year. To change a Power Query date column to contain only the year with minimal effort, you should use the built-in transformation options.
Question
You use Power Query Editor to preview a column named Date as shown in the following exhibit. You need to change the Date column to contain only the year. The solution must minimize administrative effort. What should you do?
Options
- ASplit the column by delimiter.
- BSplit the column by number of characters.
- CExtract the text after the delimiter.
- DTransform the column to contain only the year.
How the community answered
(55 responses)- A7% (4)
- B4% (2)
- C16% (9)
- D73% (40)
Why each option
To change a Power Query date column to contain only the year with minimal effort, you should use the built-in transformation options.
Splitting the column by delimiter would require identifying and using a delimiter (e.g., '/', '-') and then potentially discarding other parts, which is more complex than a direct date transformation.
Splitting the column by number of characters would necessitate knowing the exact format and character count of the year and then removing the rest, which is less robust and more cumbersome.
Extracting text after a delimiter would likely remove the year or require additional steps to isolate it, which is not the most direct or minimal effort approach for this task.
Power Query Editor provides specific date transformation functions under the 'Transform' tab that can directly extract the year from a date column with a single click. This approach is the most efficient and minimizes administrative effort compared to manual string manipulation.
Concept tested: Power Query date transformations
Source: https://learn.microsoft.com/en-us/power-query/transform-date-column
Community Discussion
No community discussion yet for this question.