Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
chris7990
New Member

How to pick out a specific value in a date field

Hey,

 

I want to pick out the month value out of a date value. The format of the date is DD/MM/YYYY.

 

When I've pulled out the month value I want to put it into a custom column with "Qtr1", "Qtr2" e.t.c. depending on the month

 

if [Monthly Reference Line] CONTAINS 10,11,12 then "Qtr 4"

 

Above is what I've tried so far

2 ACCEPTED SOLUTIONS
ValentinBIA
Resolver I
Resolver I

Hi @chris7990,

 

If you don't mind using the power query editor instead of going through DAX, then:

- Open your Query in the PQ Editor

- Make sure your date column is a Type: Date, if not, then change the type to date

- Select your date column

- On the upper ribbon, click Add Column, then Date, then Quarter, then Quarter of the year

 

This should create a new column based on the quarter of your date.

 

Hope that helps

Best,

Valentin

Did I answer your question? Mark my post as a solution!

View solution in original post

v-lili6-msft
Community Support
Community Support

Hi@chris7990

You can try to use formula as below in Edit Queries:

 

Month No=Date.Month([Monthly Reference Line])

Quarter =Date.QuarterOfYear([Monthly Reference Line])

 

Of course, you can also use DAX function to add calculate column as:

 

Month No = Month([Monthly Reference Line])

Quarter = "qtr" & INT ( FORMAT ( [Monthly Reference Line], "q") )

 

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

Hi@chris7990

You can try to use formula as below in Edit Queries:

 

Month No=Date.Month([Monthly Reference Line])

Quarter =Date.QuarterOfYear([Monthly Reference Line])

 

Of course, you can also use DAX function to add calculate column as:

 

Month No = Month([Monthly Reference Line])

Quarter = "qtr" & INT ( FORMAT ( [Monthly Reference Line], "q") )

 

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ValentinBIA
Resolver I
Resolver I

Hi @chris7990,

 

If you don't mind using the power query editor instead of going through DAX, then:

- Open your Query in the PQ Editor

- Make sure your date column is a Type: Date, if not, then change the type to date

- Select your date column

- On the upper ribbon, click Add Column, then Date, then Quarter, then Quarter of the year

 

This should create a new column based on the quarter of your date.

 

Hope that helps

Best,

Valentin

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.