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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MiKeZZa
Post Patron
Post Patron

Weighted average issue

I am preparing an weighted average and I want this output:

 

But my measure is this (based on a measure and a column):

 

Weighted Average Discount Rate = 
VAR Discount = AVERAGE('Product'[DiscountRate]) 
VAR AveragePos = [Average Position] 
Var TotalPos = CALCULATE([Average Position], ALLSELECTED(Transactions)) 
VAR PercentageOfTotal = AveragePos/TotalPos 
Var ResultPerLine = SUMX('Product', PercentageOfTotal * SUM('Product'[DiscountRate])) 
VAR Result = IF(HASONEVALUE('Product'[Contractnumber]), ResultPerLine, 8.47) 
RETURN Result

 

 And as you can see 8.47 is hardcoded, that is the needed solution. That is the total off the lines. Can somebody help me achieve this? I'm almost there....

 

I have a preview PBIX here: https://gofile.io/d/btaAgK

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi @MiKeZZa ,

 

Sorry but I am not quite sure about your issue,could you pls advise me your expected output?Or point out where the issue is...

 


Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors