![]() In this scenario, you can also use the roundup function to achieve the same thing with the same approach: ROUNDUP( MONTH('Date')/3 ,0) You can use the Ceiling function to the get the round-up number of the divide by three from the month value as below CEILING( MONTH('Date')/3 ,1) ![]() mainly a divide by three and the round it. The \ in the format string above is an escape character, that means this Q after the \ will be an actual Q letter rather than the q that will be replaced by the quarter number.Īnother way to calculate the quarter is to derive it from the month calculation. ![]() Or if you want to build a text value for it, such as QTR 1, you can do this: FORMAT('Date',"\QTR q") You can then use a function such as INT if you want to achieve the number: INT(FORMAT('Date',"q")) this will give you the Quarter number but as a text format. One easy way to calculate the quarter from a date field is the Format function with a format string of “q”. If you like to know more about calendar() function in DAX, read this article. To start this example, you can open a new Power BI file, create a new calculated table, with below expression that gives you a date table with one column: Date = CALENDAR( If you like to learn more about Power BI, read Power BI book from Rookie to Rock Star. Here in this short blog post, I explain some easy methods for calculating quarter. You might have wondered that there is no DAX Quarter function in Power BI.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |