Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

undefined

Hi everyone. Need your help for this one. Here's my sample data.   Batch KeyID Criteria 1 some1 Y 1 some2 N 2 some3 Y 2 some4 N 2 some5 Y 2 some6 N   So I ha...
  • FreemanZ's avatar
    3 years ago

    try to create two measures with this:

    KeyIDCount := CALCULATE(COUNT(TableName[KeyID]), TableName[Criteria] = "Y")
    KeyIDCountPrevBatch :=
    VAR CurrentBatch = MAX(TableName[Batch])
    RETURN
    CALCULATE(
        [KeyIDCount],
        TableName[Batch]=CurrentBatch-1
    )
     
    i tried and it worked like this: