Forum Discussion
Jenn_Hill_13
6 years agoNew Member
If statement for days with no data
Hello, I am trying to create a DAX mesaure that will show the accumnulated total of a balance sheet line item using th GL data. I have created the following measure that pulls the accumulated ba...
Nathaniel_C
Community Champion
6 years agoHi Jenn_Hill_13
Try this: did it free hand, so let me know if you have any issues. Using the Index to go back 1 row.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
BalanceCheck =
VAR _presIndex = 'tGL Combined'[Index]
VAR _prevIndex = 'tGL Combined'[Index] - 1
VAR _presCalc =
CALCULATE (
SUM ( 'tGL Combined'[Balance] ),
FILTER ( 'tGL Combined', 'tGL Combined'[Index] = MAX ( 'tGL Combined'[Index] ) )
)
VAR _prevCalc =
CALCULATE (
SUM ( 'tGL Combined'[Balance] ),
FILTER ( 'tGL Combined', 'tGL Combined'[Index] = prevIndex )
)
RETURN
IF ( _presCalc = 0, _prevCalc, presCalc )