Calculate Last 6 Week Days Average

shansakhi

Active Member
Joined
Apr 5, 2008
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hello All,
I am trying to get average of last Week Days Average in power Query as measure where if any value to calculate average is zero or not available then to be considered as blank.
Can somebody assist with it.


Regards,
Shan
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hello, @shansakhi .
1. Read forum Guidelines - we can't help you w/o sample data and expected output based on that data.
2. You mentioned "measure". It's from DAX universe, not PQ M language. What do you actually need?
 
Upvote 0
Thank you, Alien for highlighting.
I will come with a few data points.
 
Upvote 0
Here is the data
ACT DAta and BKD Data are the input data.
from A4 to H6 is Report
I5 to AH6 is backend calculation

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAH
2Backend Calculation >>>>>>>>
3ACT SF for Same Day based on Day for Same Car No and Route >>>>>BKD SF for Same Day based on Day for Same Car No and Route >>>>>
4DateDOWCar NoRouteSFCond Date6 Week Average ACT SF for same day6 Week Average BKD SF for same dayDays to DepWeek 1 for same dayWeek 1 SFWeek 2 for same dayWeek 2 SFWeek 3 for same dayWeek 3 SFWeek 4 for same dayWeek 4 SFWeek 5 for same dayWeek 5 SFWeek 6 for same dayWeek 6 SFWeek 1 for same day & Days to DepWeek 1 BKD SFWeek 2 for same day & Days to DepWeek 2 BKD SFWeek 3 for same day & Days to DepWeek 3 BKD SFWeek 4 for same day & Days to DepWeek 4 BKD SFWeek 5 for same day & Days to DepWeek 5 BKD SFWeek 6 for same day & Days to DepWeek 6 BKD SF
518-Jul-24Thursday122ABCDEF50%16-Jul-2454%67%211-Jul-2445%4-Jul-2465%27-Jun-2485%20-Jun-2436%13-Jun-2439%6-Jun-2465%454842122ABCDEF56%454772122ABCDEF65%454702122ABCDEF454632122ABCDEF55%454562122ABCDEF96%454492122ABCDEF65%
619-Jul-24Friday120DEFGHF30%12-Jul-2464%67%712-Jul-2455%5-Jul-2428-Jun-2443%21-Jun-2489%14-Jun-2467%7-Jun-2476%454857120DEFGHF66%454787120DEFGHF45%454717120DEFGHF454647120DEFGHF76%454577120DEFGHF78%454507120DEFGHF70%
7
8
9ACT Data >>>BKD Data >>>
10DataDOWCar NoRouteSFCondDay to DepAs on DateDataDOWCar NoRouteSF
1111-Jul-24Thursday122ABCDEF45%454842122ABCDEF29-Jul-2411-Jul-24Thursday122ABCDEF56%
1210-Jul-24Wednesday122ABCDEF78%454772122ABCDEF22-Jul-244-Jul-24Thursday122ABCDEF65%
134-Jul-24Thursday122ABCDEF65%454632122ABCDEF218-Jun-2420-Jun-24Thursday122ABCDEF55%
142-Jul-24Tuesday122ABCDEF97%454562122ABCDEF211-Jun-2413-Jun-24Thursday122ABCDEF86%
1527-Jun-24Thursday122ABCDEF85%454492122ABCDEF24-Jun-246-Jun-24Thursday122ABCDEF65%
1620-Jun-24Thursday122ABCDEF36%454857120DEFGHF75-Jul-2412-Jul-24Friday120DEFGHF66%
1713-Jun-24Thursday122ABCDEF39%454787120DEFGHF728-Jun-245-Jul-24Friday120DEFGHF45%
186-Jun-24Thursday122ABCDEF65%454647120DEFGHF714-Jun-2421-Jun-24Friday120DEFGHF76%
1912-Jul-24Friday121DEFGHF55%454577120DEFGHF77-Jun-2414-Jun-24Friday120DEFGHF78%
2028-Jun-24Friday121DEFGHF43%454507120DEFGHF731-May-247-Jun-24Friday120DEFGHF70%
2121-Jun-24Friday121DEFGHF89%
2214-Jun-24Friday121DEFGHF67%
237-Jun-24Friday121DEFGHF76%
Sheet1
Cell Formulas
RangeFormula
G5:G6G5=AVERAGE(K5,M5,O5,Q5,S5,V5)
H5:H6H5=AVERAGE(X5,Z5,AB5,AD5,AF5,AH5)
I5:I6I5=A5-F5
J5:J6J5=A5-MAX(0,ROUNDUP((A5-F5)/7,0)*7)
B5:B6B5=TEXT(A5,"DDDD")
L5:L6,T5:T6,R5:R6,P5:P6,N5:N6L5=J5-7
W5:W6,AG5:AG6,AE5:AE6,AC5:AC6,AA5:AA6,Y5:Y6W5=J5&$I5&$C5&$D5
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top