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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Yashi
New Member

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 gives 7 days average of hours for each date.

1 ACCEPTED SOLUTION
DOLEARY85
Resident Rockstar
Resident Rockstar

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 👍

View solution in original post

3 REPLIES 3
Yashi
New Member

Thanks, it's working.

DOLEARY85
Resident Rockstar
Resident Rockstar

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 👍

Hi
For me this below error is coming
A circular dependency was detected: Export Worksheet[7 Day Average].
Could anyone please help

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.