Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I have a day-wise collection matrix visual and in the next field of the matrix visual, I want to show the Rolling 7-day average collection.
Refer to the below sample table ( in power bi this is matrix visual) where I have type desired output. I need output like this.
Day | Collection_INR(Cr) | Rolling 7 day average Coll (desired output) |
01-Nov | 0.3 | - |
02-Nov | 0.4 | - |
03-Nov | 0.4 | - |
04-Nov | 0.2 | - |
05-Nov | 0.4 | - |
06-Nov | 0.1 | - |
07-Nov | 0.1 | 0.3 |
08-Nov | 2.5 | 0.6 |
09-Nov | 1.6 | 0.8 |
10-Nov | 2.3 | 1.0 |
11-Nov | 3 | 1.4 |
12-Nov | 2.3 | 1.7 |
13-Nov | 0.9 | 1.8 |
14-Nov | 0.6 | 1.9 |
15-Nov | 4.8 | 2.2 |
16-Nov | 2.4 | 2.3 |
17-Nov | 3.8 | 2.5 |
18-Nov | 2.8 | 2.5 |
19-Nov | 1.1 | 2.3 |
Thanks
Lavdeep
Solved! Go to Solution.
Hi @lavdeepk ,
With the index column created, try the following code.
Rolling 7 day average =
IF (
( MAX ( 'Table'[Index] ) - 7 ) < 0,
BLANK (),
CALCULATE (
SUM ( 'Table'[Collection_INR(Cr)] ),
FILTER (
ALL ( 'Table' ),
'Table'[Index] <= MAX ( 'Table'[Index] )
&& 'Table'[Index]
>= MAX ( 'Table'[Index] ) - 7
)
) / 7
)
If the problem is still not resolved, please point it out. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lavdeepk ,
With the index column created, try the following code.
Rolling 7 day average =
IF (
( MAX ( 'Table'[Index] ) - 7 ) < 0,
BLANK (),
CALCULATE (
SUM ( 'Table'[Collection_INR(Cr)] ),
FILTER (
ALL ( 'Table' ),
'Table'[Index] <= MAX ( 'Table'[Index] )
&& 'Table'[Index]
>= MAX ( 'Table'[Index] ) - 7
)
) / 7
)
If the problem is still not resolved, please point it out. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try:
Rolling 7 day average =
AVERAGEX (
FILTER (
ALL ( 'Date Table'[Date] ),
'Date Table'[Date]
> MAX ( 'Date Table'[Date] ) - 7
&& 'Date Table'[Date] <= MAX ( 'Date Table'[Date] )
),
SUM ( 'Table'[Collection INR] )
)
Proud to be a Super User!
Paul on Linkedin.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
97 | |
75 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |