Microsoft Power BI Data Analyst — Question 4
You have a CSV file that contains user complaints. The file contains a column named Logged. Logged contains the date and time each complaint occurred. The data in Logged is in the following format: 2018-12-31 at 08:59.
You need to be able to analyze the complaints by the logged date and use a built-in date hierarchy.
What should you do?
Answer options
- A. Apply a transformation to extract the first 11 characters of the logged column.
- B. Add a conditional column that outputs 2018 if the Logged column starts with 2018 and set the data type of the new column to Whole Number.
- C. Create a column by example that starts with 2018-12-31 and set the data type of the new column to Date.
- D. Apply a transformation to extract the last 11 characters of the Logged column and set the data type of the new column to Date.
Correct answer: C
Explanation
The correct answer is C because creating a new column with the date formatted as 2018-12-31 allows for proper date analysis and hierarchical usage. Option A does not provide the necessary date format, while option B creates an unnecessary conditional column that does not help in analyzing date hierarchies. Option D extracts the wrong part of the date and would not yield the correct date format for analysis.