cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chrisvdwal Frequent Visitor
Frequent Visitor

Average per day

Hi, seems too simple but I can't work this out....

 

I'd like to create a column with DAX that is the average of a column per day.

 

Sample data

 

date          value

1/1/2019   1

1/1/2019   2

1/1/2019   1

1/2/2019   1

1/2/2019   1

1/3/2019   10

1/3/2019   1

1/3/2019   1

 

so the new column would be average per day,

 

date          value  average

1/1/2019   1        1.33

1/1/2019   2        1.33

1/1/2019   1        1.33

1/2/2019   1        1

1/2/2019   1        1

1/3/2019   10      4

1/3/2019   1        4

1/3/2019   1        4

 

There is a bunch of calculation I'll do on the average, hence needing a column.

 

Thanks for any help.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pr_137 Frequent Visitor
Frequent Visitor

Re: Average per day

hii @chrisvdwal

 

 Try this ..

 

 

Average =
CALCULATE (
AVERAGE(Table1[value] ),
FILTER ( ALLSELECTED ( Table1 ), Table1[date ]=EARLIER(Table1[date ]
)))
2 REPLIES 2
Pr_137 Frequent Visitor
Frequent Visitor

Re: Average per day

hii @chrisvdwal

 

 Try this ..

 

 

Average =
CALCULATE (
AVERAGE(Table1[value] ),
FILTER ( ALLSELECTED ( Table1 ), Table1[date ]=EARLIER(Table1[date ]
)))
Highlighted
chrisvdwal Frequent Visitor
Frequent Visitor

Re: Average per day

Thanks @Pr_137, appreciate the help

 

 

I thought I had tried that, but another crack at it and it worked.

 

 

Thanks again