Forum Discussion

Vishnoo's avatar
Vishnoo
Icon for Microsoft Employee rankMicrosoft Employee
7 years ago
Solved

How to skip Blank cell during calculation?

It works fine.. thank you.. 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Vishnoo ,

     

    You can add if statement with conditions to your measures to compare with current score value and return blank if score value is blank.

    cy tot nat 1 =
    VAR cy =
        MAX ( Sheet1[Academic Year] )
    VAR Totalcount =
        CALCULATE (
            DISTINCTCOUNT ( Sheet1[Candidate ID] ),
            Sheet1[Academic Year] = cy,
            ALL ( Sheet1[School Code] )
        )
    RETURN
        IF (
            SELECTEDVALUE ( Sheet1[Score] )
                <> BLANK (),
            Totalcount
        )
    

     

    Regards,

    Xiaoxin Sheng

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Vishnoo ,

     

    You can add if statement with conditions to your measures to compare with current score value and return blank if score value is blank.

    cy tot nat 1 =
    VAR cy =
        MAX ( Sheet1[Academic Year] )
    VAR Totalcount =
        CALCULATE (
            DISTINCTCOUNT ( Sheet1[Candidate ID] ),
            Sheet1[Academic Year] = cy,
            ALL ( Sheet1[School Code] )
        )
    RETURN
        IF (
            SELECTEDVALUE ( Sheet1[Score] )
                <> BLANK (),
            Totalcount
        )
    

     

    Regards,

    Xiaoxin Sheng