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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

DAX Formula for column not working

Hello all,

I have a problem with a DAX column.  The issue is that it is bringing in the unwanted results.  Here is an example:  If the Number which is an "AccountNumber" is the same within the group and the columns 4A, 4B, 5A and 5B say ANYTHING other than "Complete" than it should say "KEEP"  else "REMOVE.  Because the below table has "Complete" and the field "Numbers are all the same, it should say "REMOVE.

With my initial DAX formula, I see that it is not correct, see below examples.  Any assistance you can provide, I would greatly appreciate.  Thank you in advance!  🙂

 

bjackson2760_0-1706219093653.png

Aother example:

 

bjackson2760_1-1706219919615.png

 

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

You can try formula like below:

NewColumn = 
IF(
    COUNTROWS(FILTER(YourTable, 
        YourTable[nber] = EARLIER(YourTable[nber]) &&
        (
            YourTable[4A Status] <> "Complete" ||
            YourTable[4B Status] <> "Complete" ||
            YourTable[5A Status] <> "Complete" ||
            YourTable[5B Status] <> "Complete"
        )
    )) > 0,
    "KEEP",
    "REMOVE"
)

vkongfanfmsft_0-1706237539105.png

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

hello v-Kongfanf-msft,

Thank you, but that didn't work.  It yielded the following results.  It says "KEEP", but it should say "REMOVE" because within that group of Numbers which is an Account Number, they say "Complete" across the rows of 4A, 4B, 5A, and 5B.

bjackson2760_0-1706279792962.png

 

Anonymous
Not applicable

Hi @Anonymous ,

 

Pls provide test data and detail desire result.

 

Best Regards,
Adamk Kong

Anonymous
Not applicable

Hi v-kongfanf,

Here is some test data:  This data is coming from a report that has counted the number of "Completes per Acct#.  It seems like whatever DAX I create wants to count from the original report.  I just need to formula to affect the current table not the detail table...
Now, what I need is the DAX that says if any of the numbers across this table have a zero there, then "KEEP", "REMOVE".  Simple enought right.  NO, not for me...its been very hard to make this happen.  If you can assist with this I would be most grateful!  🙂

AcctSum of 4A Cass CTSum of 4B Cass CTSum of 5A Cass CTSum of 5B Cass CTKEEP OR REMOVE
12348877REMOVE
15261111REMOVE
65231011KEEP
85982222REMOVE
99883122REMOVE

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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