While building a Calendar table with PowerQuery for a PowerPivot model in Excel 2013 I use its Date.QuarterOfYear function to get the number of the quarter.
Building the same thing in SSAS Tabular requires some workarounds. There's no equivalent DAX function to get number of the quarter from a DATE. Strangely, DAX has YEAR() and MONTH(), but no QUARTER().
Are nested IF
or SWITCH
statements really the only way in DAX to get the quarter number?
What is the reason for the absence such a simple and useful function? Am I overlooking the supreme wisdom of this decision?
I found an answer in this great book!
One should use =ROUNDUP(MONTH([Date])/3, 0)
to get quarter number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With