Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Marcin
Helper V
Helper V

Average per month in quarter

HI,

 

I am looking for DAX solution for this calculation:

 

QuarterMonthBonus
2018Q1Jan-1836000
2018Q1Feb-18 
2018Q1Mar-18 
2018Q2Apr-1827000
2018Q2May-18 
2018Q2Jun-18 
2018Q3Jul-1842000
2018Q3Aug-18 
2018Q3Sep-18 
2018Q4Oct-1824000
2018Q4Nov-18 
2018Q4Dec-18 

 

I would like to create a measure that will all me to get something like this:

 

QuarterMonthBonusAverage per month
2018Q1Jan-183600012000
2018Q1Feb-18 12000
2018Q1Mar-18 12000
2018Q2Apr-18270009000
2018Q2May-18 9000
2018Q2Jun-18 9000
2018Q3Jul-184200014000
2018Q3Aug-18 14000
2018Q3Sep-18 14000
2018Q4Oct-18240008000
2018Q4Nov-18 8000
2018Q4Dec-18 8000

 

I will be grateful for help with that.

 

 

1 ACCEPTED SOLUTION
Omega
Impactful Individual
Impactful Individual

Assuming you are using table 1, try creating the below measure 

 

 

Average per Quarer = CALCULATE(SUM(Table1[Bonus])/3,ALLEXCEPT(table1,Table1[Quarter]))

Average Quarter.JPG

View solution in original post

8 REPLIES 8
Omega
Impactful Individual
Impactful Individual

Assuming you are using table 1, try creating the below measure 

 

 

Average per Quarer = CALCULATE(SUM(Table1[Bonus])/3,ALLEXCEPT(table1,Table1[Quarter]))

Average Quarter.JPG

Hi @Omega,

 

This measure works only when measuer is sliced by quarter dimension . 

I have one more question, how can I create a calculated column where all those bonuses will be presented by month ? 

 

I have a salary table where each row corresponds to each month and would like to have column with bonuses calcualted as mentioned.

 

Or maybe new measure where in that table above the column with qurter will not be presented . 

 

I would like to get something like this : 

 

MonthBonusAverage per month
Jan-183600012000
Feb-18 12000
Mar-18 12000
Apr-18270009000
May-18 9000
Jun-18 9000
Jul-184200014000
Aug-18 14000
Sep-18 14000
Oct-18240008000
Nov-18 8000
Dec-18 8000

 

Marcin 

Omega
Impactful Individual
Impactful Individual

I simplified the formula. The challenge will be that all months that don't have bonuses will have zero. Power BI supresses blanks 😞 

 

Average = IF(ISBLANK(SUM(Table1[Bonus])),0,SUM(Table1[Bonus])/3)

I used this formula as calculated column and got this table , which is not I wanted to get 😕 

 

Capture.PNG

Omega
Impactful Individual
Impactful Individual

The formula in my previous post was used as a measure. If you want to use a column, try: 

 

Average  = IF(ISBLANK(Table1[Bonus]),BLANK(),Table1[Bonus]/3)

Hi @Omega,

 

thanks, I understad now.

 

Any idea how to extend those average values into months wihtout Bonus ?

 

Capture.PNG

We can also assume that there is time table with Months and Quarters as dimension. 

that works, thank you.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.