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

View all the Fabric Data Days sessions on demand. View schedule

Reply
sebastianqc
Helper I
Helper I

Average by two last week on power query or dax

Hi all ,  I have a question, how can I average the last two fields before the current field? Example:

 

example 1.PNG

 

"Promedio" is a Average  from the fields "S4 : S5" , now from the next one i need calculate the Average  from the fields "S5:S6",how i can calculate this? , im new on Power Bi 

 

Thanks for the replies

 

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

@sebastianqc ,

 

Could you please share some sample data and clairfy more details about your requirement?

 

Regards,

Jimmy Tao

@v-yuta-msft  thanks for you reply

 

 I have the feed  4 columns: semana - vigencia - USD/m3 - CPL/m3  on the Last Table.

I have this Table
 

SemDíaUSD/CLPUSD/m3CLP/m3
29lun-10-jul664,78413,01274.558,36
30lun-17-jul655,28423,95277.801,44
31lun-24-jul649,60439,35285.400,28
32lun-31-jul651,74455,33296.751,79
33lun-07-ago649,37450,7882292.728,33
34lun-14-ago646,63445,41288.015,63
35lun-21-ago642,18452,10290.324,78

My problem starts here, since as I said in the header I have to feed 4 columns in power query with tables and columns from previous table; which are:

 

Semana, the order of a week should be shown without repeating as shown in the 3rd table "Sem"

Vigencia, must show the Thursday day of each of the corresponding weeks, associated to "Dia" from the 3rd Table

Parid_sem (USD / m3), must show the average of the last two weeks of the USD / m3 field in table number 3, example: for week 31 you must average the USD / m3 of weeks 29 and 30 of table 3 for week 32 you must average the USD / m3 of weeks 30 and 31 of table 3 and so respectively.

Parid (CLP / m3), and the last table is the average of the last two values ​​(CLP / m3) of table number three, the same as the previous example, but from the CLP / m3 column.

 

thanks for help me

amitchandak
Super User
Super User

I did not completely.

But you can last 14 days /2 weeks using

Rolling 14 day = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-14,Day))  

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors