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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

DAX IF OR formula to filter NOT BLANK VALUES from Related tables

Hello,

 

I have two tables that have 1-1 relationship (via ID field) I would like to display values from both tables in one table( visual) and filter it to only show rows where the ID field ( on either of the tables) is not blank.

The solution I had innitially in mind is  ( IF Table A[ID] not blank = 1 , IF (RELATED(Table B[ID] not blank = 1 , else 0)))

and then add this collumn as a filter to the visual selecting only those with 1. But not sure of correct syntax. 

If there is a better way of doing it ?

This is the current result 

TABLE A  TABLE B  
IDNameTypeIDNameType
2231A223A 
2242B224B 
2253A   
2264B   
   340DA
5403B   
    V 
    K 
    F 

 

This is what I would like to have 

TABLE A  TABLE B  
IDNameTypeIDNameType
2231A223A 
2242B224B 
2253A   
2264B   
   340DA
5403B   

 

Thanks

 

2 REPLIES 2
ibarrau
Super User
Super User

Hi, if you want to create that column you can do it, but I think is not necessary. You can just add the id columns to the filter pane for the visualization you want to filter, the entire page or the entire report in order to filter the id as "is not blank". Add the ids to the filter pane, both of them.

If you still want the column it can be like this:

Column =
IF (
    AND(
        ISBLANK(Table A[ID]) , ISBLANK(RELATED(Table B[ID]))
    ),
    1,
    0
)

Then you can add this as filter asking for 0 (when they are not blank)

 

Regards,


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

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

I considered the filtering option but if I Add two filters: one for TableA[ID] and 1 for Table B[ID] it would only show me results that match both criteria i.e. where both fields are not blank, and I am looking for a way to do OR between the two different fields.

I tried the formula but getting an error message Too many arguments werepassed to the AND funtion ?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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