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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
dream36876
Frequent Visitor

Subtotal in Matrix Question

Hi Experts,

 

I have a matrix calculating warehouse ending inventory.

The question is, I can't display "Ending Cost" this columns's total calculation the way I want.

dream36876_3-1724929444797.png

 

I'm using 

AVERAGE('Ending Per unit'[Cost per Unit]) * SUM('Ending Inventory'[Inventory])
 
but...
The total calculation method is not what I want.
I've tried using SUMX, but it's still not giving me the result I want.

 

dream36876_4-1724929980766.png

I'm not sure if what I provided is clear. I would appreciate any help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @dream36876 ,
You can try this

Ending_Cost = 
VAR _t = 
SUMMARIZE(
    'Table',
    'Table'[Cost per Unit],
    'Table'[Inventory],
    "Sum", SELECTEDVALUE('Table'[Cost per Unit])*SELECTEDVALUE('Table'[Inventory])
)
RETURN
SUMX(_t,[Sum])

Fainal output

vheqmsft_0-1725000859080.png

 

Best regards,
Albert He


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 



View solution in original post

3 REPLIES 3
dharmendars007
Memorable Member
Memorable Member

Hello @dream36876 

 

Please try with the below formula..if doesnt work please share us the sample dataset to check further.

Measure = Sumx(Values(GdsNa), AVERAGE('Ending Per unit'[Cost per Unit]) * SUM('Ending Inventory'[Inventory]))

If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

Hello, Thanks for reply 

 

But it still doesn't work what i want

I can't share file here,how about sample data?

dream36876_0-1724936640028.png

 

Anonymous
Not applicable

Hi @dream36876 ,
You can try this

Ending_Cost = 
VAR _t = 
SUMMARIZE(
    'Table',
    'Table'[Cost per Unit],
    'Table'[Inventory],
    "Sum", SELECTEDVALUE('Table'[Cost per Unit])*SELECTEDVALUE('Table'[Inventory])
)
RETURN
SUMX(_t,[Sum])

Fainal output

vheqmsft_0-1725000859080.png

 

Best regards,
Albert He


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 



Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors