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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Specific Filter

Hello Community,

I'm new to Power BI and I have a question - I wish to filter out null values BUT ONLY for those product_ID s where there is no other string value than null. In other words, if a column contains null + other string when grouped by product_ID, then keep both null and other string values, if column grouped by the product_ID only cantains null, then I do not want to include such values. How to do that?

1 ACCEPTED SOLUTION
SamWiseOwl
Super User
Super User

Hi @Anonymous 
Where were you thinking of creating this?

As a calculated column you could do something like this:

Test value = If(
    BLANK() in CALCULATETABLE(Values(Sales[PaymentDate])) --Are there blanks in the other list
     && CALCULATE(DISTINCTCOUNT(Sales[PaymentDate])) = 1  --And there is only one variant in the data
     ,"Only Nulls", "Mixed")
 
Here for each shopping centre it is joined to a Sales table.
Each centre has multiple transactions.
If the Centre only has one transaction and its blank then return Only Nulls.
 
I could then use this as a filter on the visual.
SamWiseOwl_0-1736180384937.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hello @SamWiseOwl - brilliant, thank you so much!


Hi @Anonymous 

we wanted to kindly follow up to check if the solution provided by our community member  @SamWiseOwl  helps you? If it is worked for you please Accept it as Solution or let us know if you need any further assistance here? 

Your feedback is important to us, Looking forward to your response.

 

Thank You.



SamWiseOwl
Super User
Super User

Do the above if you want to create the column in the front end.

 

If you want to use the query editor:
Merge the two tables together

SamWiseOwl_2-1736181026548.png

 

Expand the arrows and aggregate the column with the nulls.

Tick both Count (All) and Count (Not Blank)

This will return the number of rows with and without empties.

SamWiseOwl_0-1736180951285.png

 

 

Now if one is blank and the other isn't you can filter it.

SamWiseOwl_1-1736180972744.png

 

Both these rows are NULLs


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

SamWiseOwl
Super User
Super User

Hi @Anonymous 
Where were you thinking of creating this?

As a calculated column you could do something like this:

Test value = If(
    BLANK() in CALCULATETABLE(Values(Sales[PaymentDate])) --Are there blanks in the other list
     && CALCULATE(DISTINCTCOUNT(Sales[PaymentDate])) = 1  --And there is only one variant in the data
     ,"Only Nulls", "Mixed")
 
Here for each shopping centre it is joined to a Sales table.
Each centre has multiple transactions.
If the Centre only has one transaction and its blank then return Only Nulls.
 
I could then use this as a filter on the visual.
SamWiseOwl_0-1736180384937.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.