Showing results for 
Search instead for 
Did you mean: 
Helper IV
Helper IV

To convert Window_avg tableau expression to Power BI

I'm trying to convert the Tableau Expresions to Power BI.

How to I do this window_avg in power BI.

First I got the count of the column "Profit"



then used that calculated field to find the Window_avg



WINDOW_AVG([calculation2], 0, 7).

The result is 


How do I get this in power BI.
I have attached the PBI File.



Help in this is needed.

Thanks in advance

Super User
Super User

Same way. Use the WINDOW function to create your filter context and then apply your aggregation (AVERAGEX in your case)





Can you type this window_avg for the above scenario. I tried using yours but it didn't work. I have screenshot the expected result and the PBI file for reference.


Basic concept is 

1)to get the distinctcount of the column "Profit"

2) To find the Window_avg for that distinctcount column


The expected result:


The result I'm getting:


The Dax created:


The file:sample.pbix


Help in this is really needed.
Thanks in advance



Please describe exactly want you want to measure. Is it this? 


- Average of 8-day window sum count of transactions for each day in the table looking forward (0 .. +7)

Yes somewhat like that.

First to get the distinctcount of the column profit then to find the window_avg for that.
to return the average of the expression within the window


The simple explanation is to get the count of the column and to find the window_avg for that count.
I need this in the power BI. 

@lbendlin any idea about this

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
Please show the expected outcome based on the sample data you provided.

Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors