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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
asjones
Helper IV
Helper IV

Advanced Filtering - Dynamic Filter Based on Field Value

I would like to do an Advanced Visual Filter and/or page Level Filter based on a field in a table/record with single row (thus filter on a field).  Example the table might have a field called [table]day = 14.  The Advanced filter would filter on values  <= [table]day.   That in one case might be 14 and then later 16 etc.

 

However the advanced filter contains/is/greater than/less than/etc. only look to be able to format to work on hard coded values.

 

Any thoughts?

 

thanks

 

Alan

4 REPLIES 4

It's not really clear what you want. Tables have columns and rows.  Do you mean you want to filter a column called table[day] <=14 ?  If the column only has a single value/row, why do you need this filter?



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

@MattAllington

 

 

 

Sorry for the delay in responding. I realized I did not add enough detail to my original post (normally I go into to0 much detail).  I have multiple tables (at least 2). I have started in a few cases having a an extra table generated that has information about my data that was exported from our ERP system. It has a single row and a column for each item. It has columns on the date/time the data was pulled, what environment (test vs production), various parameters used in the export of the data form our ERP to the file Power BI will use to import the data. Some of I use as my own checks and reminders. Although displaying dates/times to the user has been helpful to the consumers of the report.

 

So I have my normal "data tables" and this "parameter table".  Still don't have a good name for it.

 

I would like to do an Advanced Visual Filter and/or page Level Filter based on a field in the parameter table/record (thus filter on a field from one table to affect display of another).  Example the parameter table might have a field called [table]day = 14.  The Advanced filter would filter on values  <= [table]day.   That in one case might be 14 and then later 16 etc.  So the data table would only display stuff on or before a day passed to a filter from a parameter in another table.

 

 However the advanced filter contains/is/greater than/less than/etc. only look to be able to format to work on hard coded values.

 

 Thanks for your time and help on this

 

Alan

 

 

 

Write a measure to "harvest"  The selected date from your parameter table 

 

selection = max(parametertable[date])

 

 Then write to measure that will return a value for any date greater than its harvester measure 

display = calculate(countrows(data),filter(data,data[date] <= [selection]))

 

place the data you want to see in a table along with this measure. I think it will work. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Hi MattAllington,

 

You are definitely a genius!!! This works brilliantly. Thanks ever so much.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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