Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

DAX formula

I am migrating Tableau reports to Power BI. In Tableau report there is a formula "WINDOW_AVG(SUM([Hours]), -6, 0)". I am not able to create same formula in Power BI. Can anyone suggest? This formula ...
  • DOLEARY85's avatar
    2 years ago

    Hi,

     

    You could try a calculated column with something like this:

     

    7 Day Average = CALCULATE( AVERAGE([Hours]), FILTER( ALL('YourTable'), 'YourTable'[Date] >= EARLIER('YourTable'[Date]) - 6 && 'YourTable'[Date] <= EARLIER('YourTable'[Date]) ) )

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍