# DAX - Quarter and Half Year Formula



## jon999 (Feb 22, 2017)

Hi

Is there a DAX formula where you can sum up each quarter and half year. 

For example

             Jul     Aug   Sep   Oct   Nov   Dec   Q1    Q2      H1
Sales     100    200   300   400   500   600   600  1,500   2,100


Thanks

Jon


----------



## FranzV (Feb 23, 2017)

If you have a Calendar Table in your model, simply add a Quarter Column that you can include in your pivot in the columns fields.

```
Quarter = VALUE ( FORMAT ( 'Calendar'[Date], "Q" ) )
```
For the Semester Column:


```
Semester =QUOTIENT( 'Calendar'[Quarter] + 1 , 2 )
```
The Italians have an excellent reference for Time Intelligence calculations in their DAX Patterns website.

I hope it helps.


----------

