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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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