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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
fabiomanniti
Helper III
Helper III

Get values only for a filtered group of data

I have aa horizontal bar visual where I plotted the users with highest sales.

It is a "user name" vs "SUM(sales)" (user names and users sales are two different tables).

I also used a filter so I want to see only users with SUM(sales)>1000€.

Now, over the page I want to put other visuals in order to see some information of this group like:
how many users are there?

what's the average age?

how many men and women?

and so on...

 

But if I put on page level a filter over sales I can only use a single sale value and not the sum for the user.

 

1 ACCEPTED SOLUTION
fabiomanniti
Helper III
Helper III

What I did is creating a calculated column where I defined ranges and group names

So it was like this:

GroupName = 
var sales = CALCULATE(SUM(Sales[price]))
var groupName = SWITCH(TRUE(),
sales>1000,"DIAMOND",
sales>500,"PREMIUM",

sales>100,"GOLD"

)

return groupName

 

In this way I can use a page filter level 

View solution in original post

2 REPLIES 2
fabiomanniti
Helper III
Helper III

What I did is creating a calculated column where I defined ranges and group names

So it was like this:

GroupName = 
var sales = CALCULATE(SUM(Sales[price]))
var groupName = SWITCH(TRUE(),
sales>1000,"DIAMOND",
sales>500,"PREMIUM",

sales>100,"GOLD"

)

return groupName

 

In this way I can use a page filter level 

amitchandak
Super User
Super User

@fabiomanniti , For  this you have to use visual level filter

SUM(sales)>1000€

or create a measure like

M1= sum(Sales[Sales])

 

M2 = sumx(filter(values(sales[user]), [M1] >1000) , [Sales])

 

You can create count of user

Countx(filter(values(sales[user]), [M1] >1000) , [user])

 

For Age

M1 Age = Max(sales[Age])

 

Averagex(filter(values(sales[user]), [M1] >1000) , [M1 Age ])

 

for men women, you can axis/ legend or slicer of filter in calculate

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.