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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
RajeshLM
Helper I
Helper I

Filter logic which filters other filter dynamically

Hi All,

can you help in acheiving the below challenge which i am facing -
below is the sample data what we have in our table.
if user selects biz_id=1 then team_id should filter 2 and show only 2nd row
if user selects biz_id=2 then team_id should filter 4 and show only last 2 rows.

 

logic should be somewhat similar to this

if (  biz_id=1 and team_id=2) or  (  biz_id=2 and team_id=4) then show the respective rows

 

seq_idbiz_idteam_idproduct
111a1
212a2
311a2
421a1
522a2
623a3
724a1
824a2

 

Thanks,

Raj

1 ACCEPTED SOLUTION

Hi @RajeshLM ,

 

To be clear, measure can only be used as a visual level filter.

Try create a calculated column.

col = var max_team_id =  CALCULATE(MAX('Table'[team_id]),ALLEXCEPT('Table','Table'[biz_id]))
return IF('Table'[team_id]=max_team_id,1,0)

 

Best Regards,
Liang
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

5 REPLIES 5
V-lianl-msft
Community Support
Community Support

Hi @RajeshLM ,

 

Create a measure like this and apply it to visual level filter.

Measure = var max_team_id =  CALCULATE(MAX('Table'[team_id]),ALLEXCEPT('Table','Table'[biz_id]))
return IF(MAX('Table'[team_id])=max_team_id,1,0)

Sample .pbix

 

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

Thanks Liang.

 

This 'Measure' working fine only for visual level filter pane. but we have muliple pages and multiple visuals in each page.

when i try to add the 'Measure' in the page level filter pane, its not getting added.

 

can you please help. how can i add this 'Measure' which should work across all pages.

 

Thanks,

Rajesh

 

Hi @RajeshLM ,

 

To be clear, measure can only be used as a visual level filter.

Try create a calculated column.

col = var max_team_id =  CALCULATE(MAX('Table'[team_id]),ALLEXCEPT('Table','Table'[biz_id]))
return IF('Table'[team_id]=max_team_id,1,0)

 

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

amitchandak
Super User
Super User

@RajeshLM , Assuming biz_id Id will filter because of slicer value

 

measure =
var _team = if(selectedValue([biz_id]) =1 ,2 ,4)

return
calculate(Countrows(Table), filter(Table,Table[team_id] =_team))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

yes biz_id can be a filter but i am not able to get the desired output with this solution. can you pls share the pbix file.

output should should be the table based on below condition.

if ( biz_id=1 and team_id=2) or ( biz_id=2 and team_id=4) then show the respective rows

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.