Forum Discussion

jazking123's avatar
jazking123
Frequent Visitor
9 years ago
Solved

Aggregating daily data.

I am trying to aggregate my daily frequency data into weeks and then calculate an average of weekly sales.   So the average-average for the following data would be   Week Sales 1 ...
  • Phil_Seamark's avatar
    9 years ago

    Hi jazking123

     

    HEre is one way (of a few) that you can do it

     

     

     

    Sales2 = IF(
    				ISFILTERED('Table1'[Week]), 
    				CALCULATE(SUM('Table1'[Sales])),
    				DIVIDE
    					(
    						SUM(Table1[Sales]),
    						DISTINCTCOUNT('Table1'[Week]))
    					)