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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mhbon
Frequent Visitor

Filtering table with DAX for at least one blank()

Hi All,

 

Is there a way in which (using DAX or anything other besides M) I can filter out all the records where at least one column is blank?

For example if the source is: 

Unfiltered.png

 

Result should be:

 

filtered.png

to add on the matter; the key corresponds to a customer name in a table related to the types table. So the ideal result would be:

 

filteredC.png

 

Reason I can't do it in M is because our BI team requires me to use a Power BI service dataset as source. 

 

Any tips? 

 

Thanks in advance!

 

M

1 ACCEPTED SOLUTION
nandukrishnavs
Community Champion
Community Champion

@mhbon 

 

If you are trying to represent the data in a table visual, you could write a DAX measure and apply a visual level filter.

Measure =
VAR _type1 =
    SELECTEDVALUE ( 'Table'[Type1] )
VAR _type2 =
    SELECTEDVALUE ( 'Table'[Type2] )
VAR _type3 =
    SELECTEDVALUE ( 'Table'[Type3] )
VAR _type4 =
    SELECTEDVALUE ( 'Table'[Type4] )
VAR _type5 =
    SELECTEDVALUE ( 'Table'[Type5] )
VAR _result =
    IF (
         (
            ISBLANK ( _type1 ) || ISBLANK ( _type2 )
                || ISBLANK ( _type3 )
                || ISBLANK ( _type4 )
                || ISBLANK ( _type5 )
        ),
        "show",
        "hide"
    )
RETURN
    _result

Otherwise, you can request the data model owner to include a calculated column in the model. So, you can filter the data, page level, or report level.

CalculatedColumn =
VAR _type1 = 'Table'[Type1]
VAR _type2 = 'Table'[Type2]
VAR _type3 = 'Table'[Type3]
VAR _type4 = 'Table'[Type4]
VAR _type5 = 'Table'[Type5]
VAR _result =
    IF (
         (
            ISBLANK ( _type1 ) || ISBLANK ( _type2 )
                || ISBLANK ( _type3 )
                || ISBLANK ( _type4 )
                || ISBLANK ( _type5 )
        ),
        "show",
        "hide"
    )
RETURN
    _result



Regards,
Nandu Krishna

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 👍

Proud to be a Super User!

 


Regards,
Nandu Krishna

View solution in original post

5 REPLIES 5
mhbon
Frequent Visitor

Hi @nandukrishnavs or @amitchandak 

 

Additional diffictulty... 🙄 I requested the data in the model to be pivotted but this request was denied.

So now I'm wondering if there also a way to achieve this when the data looks like this:

 

before.png

 

and the preferred result would be this:

 

after.png

 

thanks again! 

@mhbon 

Measure =
VAR _typeCount = 3
//change the type count
VAR _x =
    CALCULATE ( COUNT ( 'Table'[Type] ), ALL ( 'Table'[Type] ) )
VAR _result =
    IF ( _x < _typeCount, "show", "hide" )
RETURN
    _result

Regards,
Nandu Krishna

nandukrishnavs
Community Champion
Community Champion

@mhbon 

 

If you are trying to represent the data in a table visual, you could write a DAX measure and apply a visual level filter.

Measure =
VAR _type1 =
    SELECTEDVALUE ( 'Table'[Type1] )
VAR _type2 =
    SELECTEDVALUE ( 'Table'[Type2] )
VAR _type3 =
    SELECTEDVALUE ( 'Table'[Type3] )
VAR _type4 =
    SELECTEDVALUE ( 'Table'[Type4] )
VAR _type5 =
    SELECTEDVALUE ( 'Table'[Type5] )
VAR _result =
    IF (
         (
            ISBLANK ( _type1 ) || ISBLANK ( _type2 )
                || ISBLANK ( _type3 )
                || ISBLANK ( _type4 )
                || ISBLANK ( _type5 )
        ),
        "show",
        "hide"
    )
RETURN
    _result

Otherwise, you can request the data model owner to include a calculated column in the model. So, you can filter the data, page level, or report level.

CalculatedColumn =
VAR _type1 = 'Table'[Type1]
VAR _type2 = 'Table'[Type2]
VAR _type3 = 'Table'[Type3]
VAR _type4 = 'Table'[Type4]
VAR _type5 = 'Table'[Type5]
VAR _result =
    IF (
         (
            ISBLANK ( _type1 ) || ISBLANK ( _type2 )
                || ISBLANK ( _type3 )
                || ISBLANK ( _type4 )
                || ISBLANK ( _type5 )
        ),
        "show",
        "hide"
    )
RETURN
    _result



Regards,
Nandu Krishna

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 👍

Proud to be a Super User!

 


Regards,
Nandu Krishna

That first one worked like a charm! Thanks! 

amitchandak
Super User
Super User

@mhbon , The measure which is showing X , should be changed to

calculate([measure], filter(Table, calculate(distinctcount(Table[Type]), all(Table)) =calculate(distinctcount(Table[Type]), allexcept(Table,Table[key]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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