Forum Discussion

chrisvdwal's avatar
chrisvdwal
New Member
7 years ago
Solved

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.

 

 

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    hii chrisvdwal

     

     Try this ..

     

     

    Average =
    CALCULATE (
    AVERAGE(Table1[value] ),
    FILTER ( ALLSELECTED ( Table1 ), Table1[date ]=EARLIER(Table1[date ]
    )))

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    hii chrisvdwal

     

     Try this ..

     

     

    Average =
    CALCULATE (
    AVERAGE(Table1[value] ),
    FILTER ( ALLSELECTED ( Table1 ), Table1[date ]=EARLIER(Table1[date ]
    )))
    • chrisvdwal's avatar
      chrisvdwal
      New Member

      Thanks Anonymous, appreciate the help

       

       

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

       

       

      Thanks again