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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
danakajoel
Frequent Visitor

SUMPRODUCT in Matrix Visual

HI,

 

I have a relatively simple dataset copied below where I am seeking to replicate SUMPRODUCT from Excel by working out the difference between sub asset classes between two dates and applying a weighting. I have been able to create the measure but it is displaying oddly in the Matrix visual in Power BI desktop so I am hoping someone can point me in the direction of what I need to add:

 

BB SummarySub AAAttributeValueWeight
GiltsGilt Long   30 June 20213941.190.25
GiltsGilt Long31 May 20213912.910.25
GiltsGilt Short30 June 2021305.480.75
GiltsGilt Short31 May 2021304.780.75

 

The table is called "Benchmark Performance (GBP)" and I have been able to create a measure as follows:

 

Value % difference from Period Start GBP =
VAR STARTVALUE = CALCULATE(SUM('Benchmark Performance (GBP)'[Value]), 'Date'[Variable Date] IN { "Period Start" })
VAR ENDVALUE = CALCULATE(SUM('Benchmark Performance (GBP)'[Value]),'Date'[Variable Date] IN { "Period End" })
VAR BBPERF = DIVIDE(ENDVALUE-STARTVALUE,STARTVALUE)
VAR RESULT = SUMX('Benchmark Performance (GBP)','Benchmark Performance (GBP)'[Weight]*BBPERF)
    RETURN
RESULT
 
This is returning what I'd expect at Sub Asset Allocation level (SUB AA) in a visual but the wrong weighting for BB Summary level:
 
danakajoel_0-1626723950272.png

In the above example, I would expect the output to be Gilts 0.18+0.17% = 0.35%

 

Any pointers greatly appreciated

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @danakajoel 

 

try it

test= SUMX(VALUES('Benchmark Performance (GBP)'[Sub AA]),[Value % difference from Period Start GBP])

View solution in original post

2 REPLIES 2
Vera_33
Resident Rockstar
Resident Rockstar

Hi @danakajoel 

 

try it

test= SUMX(VALUES('Benchmark Performance (GBP)'[Sub AA]),[Value % difference from Period Start GBP])

Hi Vera. Absolutely perfect. Thank you. I'd spent hours investigating and trying ISINSCOPE etc to no avail. I'll need to read up on the VALUES function to better my understanding but problem solved 🙂

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