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
matrix_user
Helper III
Helper III

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

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

CNENFRNL_0-1656597122881.png

 


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 still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

5 REPLIES 5
croberts21
Responsive Resident
Responsive Resident

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... 

 

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.

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

CNENFRNL_0-1656597122881.png

 


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 still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thanks CNENFRNL,

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

 

Cheers

SpartaBI
Community Champion
Community Champion

@matrix_user check out this article:https://www.daxpatterns.com/standard-time-related-calculations/
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).


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

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.

Top Solution Authors