0
votes

I have a dataset in which date value shows In quarter and values show as 2008Q1, 2008Q2, 2008Q3 and Power BI detect this column as a text and every time I tried to change its type to date the whole column shows Error keyword.

enter image description here

I want to create a new measure where I can convert quarter to year and then take the quarter average value as my calculation. 2008Q1,2008Q2 , 2008Q3,2008Q4 TO 2008.

Thanks

1
Why do you need convert to date? Date needs to have also month and days. Isn't enough to extract year as a text?Michal Palko

1 Answers

1
votes

You can just keep your current column as it is now. To achieve Year and Quarter from value for other purposes, Just create 2 new column Year and Quarter using values from your existing column. Follow these below steps in Power Query Editor-

Step-1: Duplicate your Quarter column.

Step-2: Split the new column with fixed length either with Left 4 character or Right 2 character. Now you have 2 new column first having Year and second one having New_Quarter value in the data set.

Now rename your 2 new column with related label and use where it is required.