PL-300 · Question #361
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…
The correct answer is C. Split the Logged column by using at as the delimiter. To analyze complaints by logged date using a built-in date hierarchy, the date part must first be isolated from the original text format.
Question
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?
Options
- AApply a transformation to extract the last 11 characters of the Logged column and set the data
- BChange the data type of the Logged column to Date.
- CSplit the Logged column by using at as the delimiter.
- DApply the Parse function from the Date transformations options to the Logged column.
How the community answered
(64 responses)- A11% (7)
- B3% (2)
- C81% (52)
- D5% (3)
Why each option
To analyze complaints by logged date using a built-in date hierarchy, the date part must first be isolated from the original text format.
Extracting the last 11 characters would result in ' at 08:59', which is not a valid date format and cannot be converted to a Date data type.
Directly changing the data type to Date would fail because the ' at ' string prevents Power BI from recognizing the full string as a standard date format.
Splitting the 'Logged' column by the ' at ' delimiter will separate the date string (e.g., '2018-12-31') from the time string, allowing the resulting date column to be correctly identified as a Date data type and thus enabling Power BI's built-in date hierarchy.
While the Parse function can handle various date formats, '2018-12-31 at 08:59' is not a standard format that Power Query's built-in parsing would readily interpret as a date without prior text manipulation.
Concept tested: Data transformation for date parsing
Source: https://learn.microsoft.com/en-us/power-query/split-columns
Community Discussion
No community discussion yet for this question.