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
vinaydavid
Helper III
Helper III

Mark the rows in a table as invalid based on condition ( Dax (Cal column) or M)

Hi experts,

 

I am trying to mark all the rows that that are invalid.

Please help me with Dax or M as I fairly new.

 

Col ACol BMark
WWWDon't ConsiderX
WWWConsiderX
WWWConsiderX
ABCDon't ConsiderX
ABCConsiderX
XYZConsiderOK

 

If in col B, if I find any value as "Don't Consider", then I should be able to ignore the whole bunch of rows with that ID.

 

So the result should be as column 'Mark'.

 

Thanks in advance!

1 ACCEPTED SOLUTION
VasTg
Memorable Member
Memorable Member

@vinaydavid 

 

Try this..

 

Mark =
IF (
    CALCULATE (
        MAX ( 'Table (3)'[Col B] ),
        FILTER (
            ALLEXCEPT ( 'Table (3)', 'Table (3)'[Col A] ),
            'Table (3)'[Col B] = "Don't Consider"
        )
    ) = "Don't Consider",
    "X",
    "OK"
)
 
Change the column and table names accordingly.
 
If this helps, mark it as a solution.
Kudos are good too.
Connect on LinkedIn

View solution in original post

3 REPLIES 3
VasTg
Memorable Member
Memorable Member

@vinaydavid 

 

Try this..

 

Mark =
IF (
    CALCULATE (
        MAX ( 'Table (3)'[Col B] ),
        FILTER (
            ALLEXCEPT ( 'Table (3)', 'Table (3)'[Col A] ),
            'Table (3)'[Col B] = "Don't Consider"
        )
    ) = "Don't Consider",
    "X",
    "OK"
)
 
Change the column and table names accordingly.
 
If this helps, mark it as a solution.
Kudos are good too.
Connect on LinkedIn
Anonymous
Not applicable

can I do the same condition but make in a table without add X and OK only filter the table result as a table?

Thanks a lot for the quick response VasTg.

The DAX worked in the way I want. But as I was looking at the records, I might need to add more condition in the future.

But for now, it serves my purpose.

Appreciated!! And keep up the good work 🙂

 

 

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.