Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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
Solved! Go to Solution.
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!
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
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
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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
84 | |
69 | |
68 | |
39 | |
37 |