Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
priley9406
Regular Visitor

Conditional Measure to add 1 column if another column is not null

Hi,

 

I'm trying to add the Estimated Customer Locations column if the Da Complete Date is not null.

 

This is what I'm using, but getting no results.

Completed Locations = SUMX('2022 IFP Build',IF(CALCULATE(SUM('2022 IFP Build'[Estimated Customer Locations]),'2022 IFP Build'[DA Complete Date]<>"null")>0, IF('2022 IFP Build'[DA Complete Date] = "null",0)))

 

Estimated Customer LocationsDA DateDA Complete Date
3500220202106202021
25504202021 
250320202107012021
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @priley9406 ,

 

Don't know if this is a measure or a calculate column however the word "null" will not work on this because this is dax and that is not recognized.

 

What you should use instead of "null" is the BLANK() or the "".

 

In this case you should redo your measure to:

 

 

Completed Locations =
SUMX (
    '2022 IFP Build',
    IF (
        CALCULATE (
            SUM ( '2022 IFP Build'[Estimated Customer Locations] ),
            '2022 IFP Build'[DA Complete Date] <> BLANK ()
        ) > 0,
        IF ( '2022 IFP Build'[DA Complete Date] = BLANK (), 0 )
    )
)

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @priley9406 ;

You could modify the measure as follows:

Completed Locations = 
SUMX (
    '2022 IFP Build',
    IF (
        CALCULATE (
            SUM ( '2022 IFP Build'[Estimated Customer Locations] ),
            '2022 IFP Build'[DA Complete Date] <> BLANK()
        ) > 0,
      SUM([Estimated Customer Locations]),0
    )
)

Or

Completed Locations2 = IF(MAX([DA Complete Date])=BLANK(),0,MAX([Estimated Customer Locations]))

The final output is shown below:

vyalanwumsft_0-1627984841598.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

MFelix
Super User
Super User

Hi @priley9406 ,

 

Don't know if this is a measure or a calculate column however the word "null" will not work on this because this is dax and that is not recognized.

 

What you should use instead of "null" is the BLANK() or the "".

 

In this case you should redo your measure to:

 

 

Completed Locations =
SUMX (
    '2022 IFP Build',
    IF (
        CALCULATE (
            SUM ( '2022 IFP Build'[Estimated Customer Locations] ),
            '2022 IFP Build'[DA Complete Date] <> BLANK ()
        ) > 0,
        IF ( '2022 IFP Build'[DA Complete Date] = BLANK (), 0 )
    )
)

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.