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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
JLemaire
Frequent Visitor

Conditional Filtering

I'm trying to filter a page (or something I can apply to every viz). 

 

The general structure of my two tables are:

 

P Dollars  
CustomerProd GPOut
abcCom35
bacDev10
cbaServ20
DDCom7

 

 

R Dollars  
CustomerProd GPIn
abcCom5
bacDev35
cbaServ0
DDDCom15

 

I've combined the data into a matrix where I have made the following viz

Viz   
CustomerProd GPInOut
abcCom535
bacDev3510
cbaServ020
DDDCom157

 

 

The Filter I'm trying to apply to is:

1. if Prod GP = Serv, then show all rows where In OR Out are greater than or equal to 15

2. If Prod GP <> Serv, then show all rows where In OR Out are greater than or equal to 35

 

Applying this filter would keep 3 rows of data and remove the row for CUST DDD (the row that is in Bold/Italics/Underlined). 

 

I've tried a couple if statements/calculates and gave filter a try, but I'm not familiar enough with them to get this to work. 

 

Any help would be great appreciated, 
Jason 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Keep Row = 
var selectedProdGP = SELECTEDVALUE('Table'[Prod GP])
var selectedIn = SELECTEDVALUE('Table'[In])
var selectedOut = SELECTEDVALUE('Table'[Out])
return INT(
    (selectedProdGP = "Serv" && (selectedIn >= 15 || selectedOut >= 15)) ||
    (selectedProdGP <> "Serv" && (selectedIn >= 35 || selectedOut >= 35)) 
)

vicky__0-1705009321441.png

The above is the measure that I came up with - you can place that measure in the filters pane and either keep those that are Keep Row = 1.

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

Keep Row = 
var selectedProdGP = SELECTEDVALUE('Table'[Prod GP])
var selectedIn = SELECTEDVALUE('Table'[In])
var selectedOut = SELECTEDVALUE('Table'[Out])
return INT(
    (selectedProdGP = "Serv" && (selectedIn >= 15 || selectedOut >= 15)) ||
    (selectedProdGP <> "Serv" && (selectedIn >= 35 || selectedOut >= 35)) 
)

vicky__0-1705009321441.png

The above is the measure that I came up with - you can place that measure in the filters pane and either keep those that are Keep Row = 1.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.