cancel
Showing results for
Did you mean:
Helper III

## In a new column. calculate corresponding Quarter from a date

Hello,

I've a column with dates.

NB: Date in Eu format (dd.mm.yyyy)

I would like to create a new column where Power Query would calculate corresponding Quarter/year for the date on the same line.

Example:

``````TaskFinishDate	Completion by Quarter/Year	Expected result
30.11.2022		                         Q4 22
01.03.2023		                         Q1 23
15.03.2023		                         Q1 23
13.07.2023		                         Q3 23
30.09.2023		                         Q3 23
30.03.2023		                         Q1 23
16.01.2023		                         Q1 23
31.01.2023		                         Q1 23
27.12.2022		                         Q4 22
16.01.2023		                         Q1 23
15.12.2022		                         Q4 22
16.01.2023		                         Q1 23
16.01.2023		                         Q1 23
17.04.2024		                         Q2 24
08.09.2023		                         Q3 23
06.10.2023		                         Q4 23
06.10.2023		                         Q4 23
26.01.2023		                         Q1 23
09.06.2023		                         Q2 23``````

Do someone could help me with the formulae's?

Thanks a lot

Fab

1 ACCEPTED SOLUTION
Super User

Hi @Fab117 ,

Ok, so the basic functions you need are: Date.Year and Date.QuarterOfYear. All we need to do is apply a bit of text gymnastics to get the exact output you need:

``````Text.Combine(
{
"Q",
" ",
}
)``````

Pete

Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!

2 REPLIES 2
Super User

Hi @Fab117 ,

Ok, so the basic functions you need are: Date.Year and Date.QuarterOfYear. All we need to do is apply a bit of text gymnastics to get the exact output you need:

``````Text.Combine(
{
"Q",
" ",
}
)``````

Pete

Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!

Helper III

Hi Pete,

Thank you for taking time looking at my question and also for the very clear detailled formaulae which will help me also with future challenges.

Have a nice end of the day

Fab

Announcements

#### Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

#### Power BI March 2023 Update

Find out more about the March 2023 update.

#### March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors
Top Kudoed Authors