cancel
Showing results for
Did you mean:
Helper I

## Issue with filter function in rolling month formula

Hi All,

I am trying to make a table that creates a total with postings which aren't "ment" for current month.
So like a posting thats created in feb 2021 which is a correction of jan 2021

So I want like a running total so we can see which bookings aren't cleared excluded the postings for that month which are ment for this month (economic peirod).

At first I have created a rolling total for last year with the following formula:

Actuals rolling period = calculate(sum('F Total Actuals'[Value])/1000,DATESINPERIOD('F Total Actuals'[Posting date],ENDOFMONTH('F Total Actuals'[Posting date]),-12,MONTH))

At second I have created a formula based on this rolling periode with a filter to exclude if the posting date is the same as the economic period :
Accruals >30D = CALCULATE([Actuals rolling period],filter('F Total Actuals','F Total Actuals'[Posting date]>'F Total Actuals'[Eco. Per. in date]))

When I put this in a table I get following results

Want I want to achive is a formule that gives the values from the "Actual rolling period" but without the values that I boxed in black.

With the second formula where I used the filter funciton the januari bookings are going correct, but when I check the following months it picksup the actual value and not the rolling value.

Any ideas how to solve this?

Kind Regards,
Ramon

1 ACCEPTED SOLUTION
Community Support

Hi @RNooijen ,

I think you need to create two new measures and add them to the visual.

``````Total Actuals rolling period =
IF(
ISFILTERED('F Total Actuals'[Eco. Per. in date]),
[Actuals rolling period],
SUMX(ALLSELECTED('F Total Actuals'[Eco. Per. in date]),[Actuals rolling period])
)``````
``````Total Accruals >30D =
IF(
ISFILTERED('F Total Actuals'[Eco. Per. in date]),
[Accruals >30D],
SUMX(ALLSELECTED('F Total Actuals'[Eco. Per. in date]),[Accruals >30D])
)``````

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4
Community Support

Hi @RNooijen ,

Try the following formula:

``````Actuals rolling period =
IF(
FORMAT( MAX('F Total Actuals'[Posting date]), "yyyymm" ) = FORMAT( MAX('F Total Actuals'[Eco. Per. in date]), "yyyymm" ),
BLANK(),
calculate(
sum('F Total Actuals'[Value]) / 1000,
DATESINPERIOD(
'F Total Actuals'[Posting date],
ENDOFMONTH('F Total Actuals'[Posting date]),
-12,
MONTH
)
)
)``````
``````Accruals >30D =
IF(
MIN('F Total Actuals'[Posting date]) > MAX('F Total Actuals'[Eco. Per. in date]),
[Actuals rolling period]
)``````

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helper I

@v-kkf-msft  Hi Winniz,

Thanks alot, this looks like the solution!

The only thing I have now with this formula is that it looks like the values aren't in a number format (I won't get totals).

I also tried to change the format to decimal/ whole number, but I still don't get the Totals in the table like bellow

Any Idea how I could solve this?

Thanks alot!

BR,

Ramon

Community Support

Hi @RNooijen ,

I think you need to create two new measures and add them to the visual.

``````Total Actuals rolling period =
IF(
ISFILTERED('F Total Actuals'[Eco. Per. in date]),
[Actuals rolling period],
SUMX(ALLSELECTED('F Total Actuals'[Eco. Per. in date]),[Actuals rolling period])
)``````
``````Total Accruals >30D =
IF(
ISFILTERED('F Total Actuals'[Eco. Per. in date]),
[Accruals >30D],
SUMX(ALLSELECTED('F Total Actuals'[Eco. Per. in date]),[Accruals >30D])
)``````

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helper I

Hi @v-kkf-msft,

Thanks a lot! This solved my issue!

Kind Regards,

Ramon

Announcements