Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
Solved! Go to Solution.
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 still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
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"
)
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
@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).
User | Count |
---|---|
41 | |
27 | |
23 | |
18 | |
15 |
User | Count |
---|---|
54 | |
35 | |
19 | |
18 | |
15 |