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
KaroRoza
Helper I
Helper I

FILTER OUT null values

Hello,

Could you please help me with the problem? 

I would like to add Filter/Slicer to the dashboard to allow User to filter out table depending if he want to see also null rows.

'TP USD' is measure CALCULATE( divide(SUM GOR), SUM(Units)). I have table with Countries, Years, Products sold. If there are no sales from Factory at that year there is no 'TP USD',  only measure 'SalesPrice1). 

In Filters panel I can filter it out as 'is not blank' but I want User to decide if he wants to see all or only Products with both Factory ans Sales price. Filters panel is hidden.

When I add measure 'TP USD' to slicer it is not allowed, but I want to get something like slicer with option: 'ALL', 'Both Factory and Market".

 

Could someone help me please.

 

 

KaroRoza_0-1732027847750.png

to get:

 

KaroRoza_1-1732027913621.png

 

 

2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

Use the Enter Data functionality to create a disconnected table which you will use in the slicer.

You can then create a measure to use as a filter

Row is visible =
IF (
    SELECTEDVALUE ( 'Slicer Table'[Value] ) = "All",
    1,
    IF ( NOT ISBLANK ( [TP USD] ) && NOT ISBLANK ( [SalesPrice1] ), 1 )
)

Add this as a filter to your matrix visual, to only show when the value is 1.

View solution in original post

Anonymous
Not applicable

Hi, @KaroRoza 

 

I've simply modeled some data that hopefully fits your situation. As @johnt75  says, first create a slicer table.

vzhangtinmsft_0-1732090152317.png

Measure = SWITCH(TRUE(),
SELECTEDVALUE('Slicer Table'[Value])=BLANK(),1,
SELECTEDVALUE('Slicer Table'[Value])="All",1,
SELECTEDVALUE('Slicer Table'[Value])="Both Factory and Market"&&[TP USD]<>BLANK(),1
)

vzhangtinmsft_1-1732090306054.pngvzhangtinmsft_2-1732090315585.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi, @KaroRoza 

 

I've simply modeled some data that hopefully fits your situation. As @johnt75  says, first create a slicer table.

vzhangtinmsft_0-1732090152317.png

Measure = SWITCH(TRUE(),
SELECTEDVALUE('Slicer Table'[Value])=BLANK(),1,
SELECTEDVALUE('Slicer Table'[Value])="All",1,
SELECTEDVALUE('Slicer Table'[Value])="Both Factory and Market"&&[TP USD]<>BLANK(),1
)

vzhangtinmsft_1-1732090306054.pngvzhangtinmsft_2-1732090315585.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

johnt75
Super User
Super User

Use the Enter Data functionality to create a disconnected table which you will use in the slicer.

You can then create a measure to use as a filter

Row is visible =
IF (
    SELECTEDVALUE ( 'Slicer Table'[Value] ) = "All",
    1,
    IF ( NOT ISBLANK ( [TP USD] ) && NOT ISBLANK ( [SalesPrice1] ), 1 )
)

Add this as a filter to your matrix visual, to only show when the value is 1.

Could you please write it step by step?

What columns should I have in the table?

 

KaroRoza_0-1732030535935.png

 

Create a new table with the expression

'Slicer Table' = { "All", "Both Factory and Market" }

That will create a table with a single column called "Value".

Add the Value column to a slicer.

The measure should now work if you use it as a filter.

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.