Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No QUARTER() in DAX? Really?

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?

like image 448
erop Avatar asked Sep 08 '15 20:09

erop


1 Answers

I found an answer in this great book!

One should use =ROUNDUP(MONTH([Date])/3, 0) to get quarter number.

like image 84
erop Avatar answered Oct 12 '22 07:10

erop