Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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.
Hi guys,
Unfortunately i dont have idea how to resolve my problem. So i have 2 tables:
IDA | Group |
A | 1 |
B | 1 |
B | 2 |
B | 2 |
B | 2 |
C | 3 |
The second one:
IDA | Counts |
A | 2 |
B | 4 |
C | 4 |
So i would like to count from those table weighted statistics by group i mean:
For group 1: ((1/2)+(1/4)+(0/4))/3 = 25%
For group 2: ((0/2)+(3/4)+(0/4))/3 = 25%
for group 3: ((0/2)+(0/4) + (1/4))/3 = 8.3%
I would like to create is as a measure, but as i mention before i don't have idea. I tried by sumx and summarised but i didn't get any rational results.
Thanks in advance for your help.
Solved! Go to Solution.
Hi @konwes97
Here's some DAX that works for your example data:
Weighted =
VAR _Numerator =
SUMX('Groups Table', DIVIDE(1, RELATED('Counts Table'[Counts])))
VAR _Denominator = COUNTROWS(ALL('Counts Table'))
VAR _Result = DIVIDE(_Numerator, _Denominator)
RETURN
_Result
The tables have a relationship like this:
Hi @konwes97
Here's some DAX that works for your example data:
Weighted =
VAR _Numerator =
SUMX('Groups Table', DIVIDE(1, RELATED('Counts Table'[Counts])))
VAR _Denominator = COUNTROWS(ALL('Counts Table'))
VAR _Result = DIVIDE(_Numerator, _Denominator)
RETURN
_Result
The tables have a relationship like this:
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
16 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |