Forum Discussion
Rolling Sum issue - help
- 3 years ago
Hi,
Please try the below measure that I amended a little bit, and please check the attached file.
Rolling sum measure: = IF ( NOT ISBLANK ( [Total bonus measure:] ) && HASONEVALUE ( Data[Pro Id] ), CALCULATE ( [Total bonus measure:], FILTER ( ALL ( Data ), Data[Pro Id] = MAX ( Data[Pro Id] ) ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ) ) - Anonymous3 years ago
Ecellent. It worked. Thank you!
Appreciated.
Hi,
I am not quite sure if I understood your question correctly, but I assume you want to NOT show the rolling total result if the bonus is empty.
Please check the below picture and the attached pbix file.
I tried to create a sample pbix file that the datamodel looks like below.
I hope the below can provide some ideas on how to create a solution for your datamodel.
Rolling sum measure: =
IF (
NOT ISBLANK ( [Total bonus measure:] ),
CALCULATE (
[Total bonus measure:],
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
Hi, Thanks for the code. But, the rolling sum messed up as soon as I added other columns, Account Name and Name. please see below, starting row 3 it started the new rolling sum, as this is part of same Pro Id, the rollowing should continue from Top.
please advise. Appreciate your help.
- Jihwan_Kim3 years ago
Super User
Hi,
Please try the below measure that I amended a little bit, and please check the attached file.
Rolling sum measure: = IF ( NOT ISBLANK ( [Total bonus measure:] ) && HASONEVALUE ( Data[Pro Id] ), CALCULATE ( [Total bonus measure:], FILTER ( ALL ( Data ), Data[Pro Id] = MAX ( Data[Pro Id] ) ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ) )