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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

how to calculate the average per day, basd on one value

Hi all, I have a question about the following:

 

I have a table, in which MON turnover is mentioned on 04/01/2018 (117.000)

Now I want to add a column, in which the average MON turnover per day is automatically calculated.

Can anybody help me with the DAX formula for this?

 

Thanks!

 

John

 

Date                 Turnover MON  Average Turnover per day MON

01/01/2018      0                        29.250  

02/01/2018      0                        29.250

03/01/2018      0                        29.250 

04/01/2018      117.000             29.250

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Ashish,

 

I tried it and this is exactly what I need.

Thanks a lot!

 

John

View solution in original post

7 REPLIES 7
ChandeepChhabra
Impactful Individual
Impactful Individual

@Anonymous,

 

Try this calculated column

 

=SUM('Table'[Turnover MON])/COUNTROWS('Table')

Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula

 

=CALCULATE(MAX(Data[Turnover MON])/COUNTROWS(Data),ALL(Data))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Good day Ashish,

Thanks for your reply, it helps me a lot!

However, now I face a new challenge. 

If I want to use this formula over a certain period, can I do that as well?

for example: I want to use this formula for the january data and seperately or for february data

 

Thanks upfront for your help in this,

 

John

 

Date                 Turnover MON  Average Turnover per day MON

01/01/2018      0                        29.250  

02/01/2018      0                        29.250

03/01/2018      0                        29.250 

04/01/2018      117.000             29.250

03/02/2018      0                        70.000

04/02/2018      210.000              70.000

05/02/2018      0                         70.000

 

 

Hi,

 

I created 2 calculated columns

 

Month-Year = FORMAT(Data[Date],"mmm-yy")

Result = CALCULATE(SUM(Data[Turnover Mon]),FILTER(Data,Data[Month-Year]=EARLIER(Data[Month-Year])))/CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Month-Year]=EARLIER(Data[Month-Year])))

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

I tried it and this is exactly what I need.

Thanks a lot!

 

John

You are welcome.  If my reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
danextian
Super User
Super User

Hi @Anonymous,

 

As a measure, you can simply use

 

Avg Turnover MON - Measure =
AVERAGE ( Table[Turnover MON] )

 

and then place this measure in a table with dates. The measure will be automatically filtered based on the date.

 

 

As a calculated column, you need to use CALCULATE() function to specify a filter

 

 

 

Avg Turnover MON - Column =
CALCULATE (
    AVERAGE ( 'Table'[Turnover] ),
    /* This is the filter telling DAX to 
"For the whole table, get me the average of Turnover MON
if the date is equal to this one." */ ALL ( 'Table' ), 'Table'[Date] = EARLIER ( 'Table'[Date] ) )

Alternatively, you can also use the fomula below which result is the same as the one above.

Avg Turnover MON - Column2 =
CALCULATE (
    AVERAGE ( 'Table'[Turnover] ),
    ALLEXCEPT ( 'Table', 'Table'[Date] )
)

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Top Kudoed Authors