Skip to main content
Microsoft Idea

Power BI

Needs Votes

New DAX Function: FILTERCONTEXT ()

Vote (16) Share
Alexander Dupler's profile image

Alexander Dupler on 13 Mar 2020 13:41:30

There are a number of applications where you want a DAX expression to return every filter currently effecting a visual. There should be a function that does this. Today you can get this effect by creating an expression like: IF(ISFILTERED () ,SELECTEDVALUE () ) for every column you care about. or something even more complicated to trap multiple values. And it doesn't trap equalities or other things.
Instead, there should be a single function that just returns the current context as a string.

On the report canvas, the new popup filter context card does a great job of highlighting this to users, but it doesn't cover all use cases.

Some example applications:

Complicated DAX aggregations may need to know the exact filter conditions not just the resulting values in filtering column. Things like Accordian or Horizontal aggs could be even more efficient if you know whether someon picked 43 particular days, or just picked a date range with an equality.

Using Gil Raviv's Power BI Pixel technique to track usage, you might want a verbose statement of context.

Creating label measures that show the current filter context explicitly: While the new filter cards are great they don't work in zero applications dashboards. Also sometimes, you want the context to be plainly visible to all users.

Comments (1)
Alexander Dupler's profile image Profile Picture

Mitch Marois on 13 May 2021 23:20:47

RE: New DAX Function: FILTERCONTEXT ()

Just came across this use case today and think it would be a great addition for DAX to return the current filter context via measure like FILTERCONTEXT() similar to how you can see which filters are impacting each visual when you hover over the filter icon.