This is definitely possible.
1) First, you'll need to turn your Date field into an actual date (currently, it's a string).
2) Second, create your parameter, which I've called Subtract.
3) Create a calculated field, which I've called Balance Adjusted.
// If the hour is 11 or 14, we want to subtract the amount from our total. Be sure to only include 11:00 and 14:00 exactly (not 11:30 or 14:30).
IF (ATTR(DATEPART('hour', [Date]))=11 OR ATTR(DATEPART('hour', [Date]))=14) AND ATTR(DATEPART('minute', [Date]))=0 THEN
4) Replace the Balance measure on your view with Balance Adjusted.
See attached workbook.
Book5_v10.5.twbx 71.3 KB
Thanks Ken, I have been fiddling around with it a bit more, the end-user also wants to add a delay to the balance (30min, 60min, 90min, 120min), so I have created a parameter with:
And then I work with this calculation: LOOKUP(ZN(SUM([Balance])), -[Delay]) and that will be Balance Previous.
Which works. So now I wanted to combine the Subtract and Delay in one Balance:
Which also works. But I want it to restart every DATE so at 00:00 all these modifications should restart (its a new day ).
I think I have figured it out, created a calc:
[Code] + STR(DATE([Date]))
Added that to the calculation, and restart every date, seems to do what I want.
Book5_v10.5 v3_v10.5.twbx 112.4 KB
Great. Glad you got it working!