Forum Discussion

Rsanjuan's avatar
Rsanjuan
Advocate III
9 years ago
Solved

Calculate and ignoring null value

What is the correct syntax for calculating the sum of a column only if another column is not null? For example,

 

I would only want to calculate the numbers in the second column, where Column A is not null.

 

Thanks!

 

  • Please try this measure

     

     

    Measure = CALCULATE(
    				SUM(Table1[Column B]),
    				'Table1'[Column A]<> BLANK()
    				)

2 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    Please try this measure

     

     

    Measure = CALCULATE(
    				SUM(Table1[Column B]),
    				'Table1'[Column A]<> BLANK()
    				)
    • Dean1972's avatar
      Dean1972
      Frequent Visitor

      How would you write the measure if you have various date columns that return "null"
      Table = PRJ
      Columns = Billing, Due, etc