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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Aaron_BI
Regular Visitor

Create Dynamic Groups That Can Filter Other Visuals

Hi,

 

I'm trying to achieve the following:

  1. Group customers based on their sales amount
  2. Customers should be assigned to a group dynamically based on a date filter
  3. When using this grouping in a visual, I want it to be able to filter the other visuals on a page when clicking on a specific group

 

I've been able to get 1 & 2 done, but I could use some help with 3. 

 

To illustrate, I have the following data model, where I simply have a table with a list of customers, and a table with a list of transactions with those customers.

Aaron_BI_0-1615975328151.png

Aaron_BI_1-1615975343844.pngAaron_BI_2-1615975357681.png

 

In addition, I created a third table that isn't related to any other table which contains the groups I want to use: 

Aaron_BI_3-1615975453783.png

 

I've written the following measure that will sum the sales per customers, places each customer within one of these groups based on their total sales, and counts the number of customers per group. This measure also listens to a date filter I have on the page: 

 

Sales Per Group = 

/* Determine the upper and lower bound per group */
VAR LowerBound = MIN('Total Sales Group'[Lower Bound])
VAR UpperBound = MIN('Total Sales Group'[Upper Bound])

/* Calculate the total sales per customer */
VAR SalesPerCustomer = GROUPBY(Sales,Customers[ID],"TotalSales",SUMX(CURRENTGROUP(),Sales[Amount]))

/* Based on the table created in the previous step, determine which customers fall within the current group */
VAR CustomerPerGroup = 
FILTER(
    FILTER(
        SalesPerCustomer,
        [TotalSales] >= LowerBound
    ),
    [TotalSales] <= UpperBound
)

RETURN
COUNTROWS(CustomerPerGroup)

 

The last hurdle I need to get over is to get the visual in which I use this measure to filter the other visuals on the page. As seen on the image below, I've selected the 400 - 500 group, however the table still shows all customers, whereas I'd like it to show only the customers that fall in the 400 - 500 group.

 

Aaron_BI_4-1615975733942.png

 

Any input on how I can achieve this would be much appreciated!

 

Thanks,

Aaron 

1 REPLY 1
amitchandak
Super User
Super User

@Aaron_BI , seem like you are looking for a dynamic segmentation with independent table

refer if my video can help https://youtu.be/CuczXPj0N-k

or

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors