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
RobX
Advocate I
Advocate I

Dynamic Group Filtering

I'm looking to create a slicer filter that works against an aggregated value.

 

I have the following table where column be in summed in a visual.

RobX_0-1610719401998.png


And I have a second table with the following groups

RobX_1-1610719438674.png

 

If I select 0-5 in the slicer, the visual would filter for only A since the aggregated value is 3.

If I select 11-15, the visual would filter for only C since the aggregated value is 11.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@RobX 

Create a table for the group as follows

Group   mn     mx

0 - 505
6 - 10610
11 - 151115

 

Create the following measure and assign it to the visual filter and set it to 1

Group Selected = 

var __groupmn = SELECTEDVALUE(tGroup[mn])
var __groupmx = SELECTEDVALUE(tGroup[mx]) 
var __value = CALCULATE(SUM(T15[Value]))
return
IF( 
    __value >= __groupmn && __value <= __groupmx,
    1,
    0
)

Screenshot 2021-01-15 173244.jpg

 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

 

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@RobX 

Create a table for the group as follows

Group   mn     mx

0 - 505
6 - 10610
11 - 151115

 

Create the following measure and assign it to the visual filter and set it to 1

Group Selected = 

var __groupmn = SELECTEDVALUE(tGroup[mn])
var __groupmx = SELECTEDVALUE(tGroup[mx]) 
var __value = CALCULATE(SUM(T15[Value]))
return
IF( 
    __value >= __groupmn && __value <= __groupmx,
    1,
    0
)

Screenshot 2021-01-15 173244.jpg

 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

 

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks Fowmy.  There was one thing I had to change.  When no group is selected, the value was 0 so the charts wouldn't populate.  I had to update the if statement to 

 

IF(
    __groupmn = Blank() && __groupmx = Blank(),
    1,
    IF( 
        __value >= __groupmn && __value <= __groupmx,
        1,
        0
    )
)

 

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.