Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hello, I am trying to generate a rolling 4 week cash flow. I am unable to send a file because of the private nature of the data so I will try to be succinct as possible.
My Weekly Cash Flow measure has the correct value:
Can someone point out my error? Thank you.
Hi @Anonymous ,
Since you did not give a specific table, I had to create my own table for testing according to your description, please point out if there are any problems.
Please try below steps:
1. below is my test table
Table:
2. add a new column with below dax formula
Index = RANKX('Table',[FW EndOfWeek],,ASC)
3. create a measure and add it to table visual
Measure =
VAR cur_index =
SELECTEDVALUE ( 'Table'[Index] )
VAR tmp =
FILTER (
ALL ( 'Table' ),
'Table'[Index] >= cur_index - 3
&& 'Table'[Index] <= cur_index
)
VAR sum_for_4weekly =
SUMX ( tmp, [Weekly Cash Flow] )
RETURN
IF (
cur_index < 4,
SELECTEDVALUE ( 'Table'[Weekly Cash Flow] ),
sum_for_4weekly
)
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, I cleaned up my file and copied it here: https://drive.google.com/drive/folders/1k0Nw-TT7gOr0tOW6Nn9AmDKyoOPPTbNJ?usp=sharing Any additional help you can provide is appreciated.
Thank you for your help. My Weekly Cash Flow is in a different related table from my date table so I am getting this error:
Hi,
I might be looking at this the wrong way but, would this work?:
CALCULATE ( SUM ( [Weekly Cash Flow]), DATESINPERIOD ('Date'[Date], MIN ( 'Date'[Date] ), -28, DAY ) )
Thank you for your reply. Regrettably the same value is created with this method.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!