cancel
Showing results for
Did you mean:
Helper II

## Calculated column Jan - Mar, Apr - Jun, Jul - Sep, Oct - Dec

I am seeking a calculated column dax to display quarter dates (01/01/2022 - 31/03/2022 etc) but also have the ability to change the format (01 Jan 2022 - 31 Mar 2022)

Thank you

1 ACCEPTED SOLUTION
Super User
``````Yr-Qtr =
YEAR( [Date] ) & " "
& SWITCH(
QUARTER( [Date] ),
1, "Jan-Mar",
2, "Apr-Jun",
3, "Jul-Sept",
"Oct-Dec"
)``````

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is beyond their comprehension! DAX is simple, but NOT EASY!
5 REPLIES 5
Post Patron

Are you wanting to create the dates in each quarter to sum numbers in each quarter? Try using DATESQTD as a filter to the SUMX function. https://docs.microsoft.com/en-us/dax/datesqtd-function-dax

Is that what you want? What is the final task you want to accomplish?

You can also search the internet for quarter calculations in Power BI. https://www.google.com/search?channel=nus5&client=firefox-b-1-d&q=%2B%22power+bi%22+quarter+calculat...

Helper II

I want the functionality to put for example, the date of 15/2/22 into the "Jan-Mar 22" category. I want it in calculated column. So I want to learn how to write a dax that will acomplish the "Jan-Mar 22" result.

Super User
``````Yr-Qtr =
YEAR( [Date] ) & " "
& SWITCH(
QUARTER( [Date] ),
1, "Jan-Mar",
2, "Apr-Jun",
3, "Jul-Sept",
"Oct-Dec"
)``````

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is beyond their comprehension! DAX is simple, but NOT EASY!
Helper II

Thanks CNENFRNL,

The DAX is what I needed. I made a change to it - so that the year is at the end.

Cheers

Community Champion

Read it carefully and it will give you what you want (you will see there how to create a data table and it will point you to what you need and much more).

Announcements

#### The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

#### Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!