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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PshemekFLK
Helper IV
Helper IV

SUMX weighted average doesn't work

Hi,

 

I can't figure out why sumx doesn't result in the correct weighted average:

 

PshemekFLK_0-1616508399501.png

Formula for Funnel Speed (Months) = 

IF( HASONEVALUE('Funnel Data'[Opportunity Closed Mo No]),
     SUM('Funnel Data'[Funnel Speed])/30,
             DIVIDE(SUMX('Funnel Data','Funnel Data'[Funnel Speed]/30*'Funnel Data'[Opportunities Won Value USD]),
                       SUM('Funnel Data'[Opportunities Won Value USD])))
 
The correct result for Total should be ((15,561*1.9)+(17,999)*0.4)+(47,335*3.9))/80,895 = 221,337/80,895 = 2.7 instead of 1.2
 
There are visual filters applied on that matrix. Is that the issue?
 

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@PshemekFLK , try a measure like

 


Formula for Funnel Speed (Months) =
IF( Sumx(values('Funnel Data'[Opportunity Closed Mo No]),calculate(
SUM('Funnel Data'[Funnel Speed])/30,
DIVIDE(SUMX('Funnel Data','Funnel Data'[Funnel Speed]/30*'Funnel Data'[Opportunities Won Value USD]),
SUM('Funnel Data'[Opportunities Won Value USD]))))

@amitchandak 

PshemekFLK_0-1616519430559.png

When I try to fix the brackets in this formula I still get 1.2 as Total not 2.7.

 

I see you've changed the first part of the formula. I thought it's the second DIVIDE part that produces a wrong result.

 

 

Can anyone give it a try? I still can't get to the right result

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors