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 this data:
I am trying to get a weighted average, per LL.
That shall be the sum of: TotalPerCustomer * MDMCustomer / Total.
(The code for MDMCustomer is [TotalPerCustomer]/[MaxCustomer])
So for L1 it shall be: (50*1 + 35*1,4) /85 //(Whenever I try to do it, I get 35*1,4 twice)
And for L2 it shall be: (35*1,75) / 35
How can I achieve it?
@Anonymous
You can create the following measure to calculate the weighted average:
M =
var __t =
CALCULATETABLE( SUMMARIZE(Table3,Table3[LL],Table3[CUST], "Total", MAX(Table3[Total Per Customer]),"MDS", MAX(Table3[MDS Customer])), ALLEXCEPT(Table3,Table3[LL] ))
var __Total = SUMX( __t , [Total] )
var __line = SUMX( __t , [Total] * [MDS] )
return
DIVIDE( __line , __Total )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |