Forum Discussion
Anonymous
3 years agoNot applicable
Rolling 4 Week Cash Flow
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 measu...
Anonymous
3 years agoNot applicable
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.
Anonymous
3 years agoNot applicable
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: