cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Usinghal
Helper I
Helper I

Power query

Hi

How can we add quarter column using date in power query not dax

Any help would be appreciated

Thanks in advance

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Usinghal ,

 

To get calendar quarters you can just use:

 

Date.QuarterOfYear([Date])

 

 

To get financial quarters, you will first need to define your financial periods as period numbers against each date. Then you can use the following referencing the financial period:

 

Table.AddColumn(previousStep, "finQtr", each
if [finPeriod] >= 1 and [finPeriod] <= 3 then "Q1"
else if [finPeriod] >= 4 and [finPeriod] <= 6 then "Q2"
else if [finPeriod] >= 7 and [finPeriod] <= 9 then "Q3"
else "Q4"),

 

 

Pete

View solution in original post

1 REPLY 1
BA_Pete
Super User
Super User

Hi @Usinghal ,

 

To get calendar quarters you can just use:

 

Date.QuarterOfYear([Date])

 

 

To get financial quarters, you will first need to define your financial periods as period numbers against each date. Then you can use the following referencing the financial period:

 

Table.AddColumn(previousStep, "finQtr", each
if [finPeriod] >= 1 and [finPeriod] <= 3 then "Q1"
else if [finPeriod] >= 4 and [finPeriod] <= 6 then "Q2"
else if [finPeriod] >= 7 and [finPeriod] <= 9 then "Q3"
else "Q4"),

 

 

Pete

View solution in original post

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors