Forum Discussion

HenryJS's avatar
HenryJS
Icon for Post Prodigy rankPost Prodigy
6 years ago

DAX: Return if column IS NULL

Hi all,

 

How do I add to the below statement IF 'Column' Is Null then count?

 

Candidate Calls =
VAR LatestMonday = today() - weekday(today(),2) + 1
RETURN max(0,calculate(COUNT('Export Actions'[CandidateRef]),'Export Actions'[ActionName] in {"Call - Check In","Call - Follow Up", "Call - Proactive Approach", "Call - Update"}, 'Export Actions'[ActionDate] >= LatestMonday))

5 Replies

    • HenryJS's avatar
      HenryJS
      Icon for Post Prodigy rankPost Prodigy

      Hi amitchandak 

       

      'Export Actions'[Contact]

       

      I only want it to count when the Contact column Is Null

       

      • BA_Pete's avatar
        BA_Pete
        Icon for Super User rankSuper User

        Hi HenryJS ,

         

        It might be easier to add a column into the 'Export Actions' table:

         

        ContactIsBlank = 
        if( isblank( 'Export Actions'[Contact] ), 1, 0)

         

        Then do a count/sum on this column within other measures.

         

        Not sure if this meets your requirements but much simpler than trying to write the logic into every other measure.

         

        Pete 

  • V-lianl-msft's avatar
    V-lianl-msft
    Icon for Community Support rankCommunity Support
    Hi HenryJS ,
     
    "COUNTBLANK" function may help you solve this problem.
    If the problem persists,could you please share sample data or sample pbix?
    (Please mask any sensitive data before uploading)
     
    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.