Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
hello Experts,
I hope you can help me with a challange:
Very "boiled down", I have four tables in Power BI, "customer" (columns: customer, customer chain), "Activity" (column: "number of contacts made to the customer"), "Organisation" (column: "Sales person").
I have a "matrix"-visual showing the average number of contacts per customer on "Chain"-level for each Sales person:
now, If I want to calculate the average of chains for each sales person, I have made this measure:
Average contact per Chain=
VAR ChainAverage =
AVERAGEX(
'Activity',
'activity'[index]
)
RETURN
AVERAGEX(
VALUES('Customer'[Customer Chain]),
ChainAverage
)
which, in essense, works.
However, my problem is that the "Average total" is not correct (if I manually calculate the average shown, I get the averages shown in red). I expect the reason for this is that power bi calculates on the row in context. I.e. it calculates the "Average total" horizontal. What I need, is to "force" the measure to calculate the average vertically.
Do anyone know how to do this?
thanks. All ideas are much appreciated.
Br,
Jayjay0306
Solved! Go to Solution.
Your second AVERAGEX isn't doing anything since ChainAverage is a constant value once it's defined (it's the same for each row in the customer chain iterator).
I think you might want something more like this:
AVERAGEX (
SUMMARIZE (
Activity,
Customer[Customer Chain],
"@ChainAvg", AVERAGE ( activity[index] )
),
[@ChainAvg]
)
(This assumes you have a one-to-many relationship from Customer to Activity.)
Thanks AlexisOlson, it is exactly what I want.
bloody brilliant 🙂
br,
Jayjay0306
Hi @jayjay0306 ,
I create a table as you mentioned.
Then I put it into the matrix visual.
If you want the vertical average column you are talking about, I think you can just make the change.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Your second AVERAGEX isn't doing anything since ChainAverage is a constant value once it's defined (it's the same for each row in the customer chain iterator).
I think you might want something more like this:
AVERAGEX (
SUMMARIZE (
Activity,
Customer[Customer Chain],
"@ChainAvg", AVERAGE ( activity[index] )
),
[@ChainAvg]
)
(This assumes you have a one-to-many relationship from Customer to Activity.)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |