The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
Solved! Go to Solution.
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
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
@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
User | Count |
---|---|
69 | |
65 | |
63 | |
55 | |
28 |
User | Count |
---|---|
112 | |
81 | |
65 | |
48 | |
43 |