Forum Discussion
BudMan512
Helper V
3 years agoMissing Tickets
Hey, I am having trouble figuring out what appears to be a fairly simple report. Any help would be appreciated. I have a Sales table containing 3 different batches of delivery tickets. The Ticket...
vicky_
Super User
3 years agoHere's what i've got for the dax:
Diff =
var previousTicket = CALCULATE(MAX('Table'[Ticket]), ALL('Table'[Ticket]), 'Table'[Ticket] < SELECTEDVALUE('Table'[Ticket]))
var previous = IF(ISBLANK(previousTicket), SELECTEDVALUE('Table'[Ticket]), previousTicket)
return CALCULATE(SUM('Table'[Ticket]) - previous)
BudMan512
Helper V
3 years agoHi Vicky,
Here is a screenshot of my real world data. I have substituted 'History'[HIST_REF_NO] for 'Table'[Ticket] in your script. As you can see, the calculation starts out fine but soon goes off the rails. I wonder if you see what the issue might be. Thanks for your help.
Bud