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
alexglickfire
Frequent Visitor

How not to apply cost formula in the Total

Hello!

 

Currently building a report for overstock and the formula that was made by DAX is also applying to the total column therefore show a huge number that is entirly wrong, how do i fix this?

 

I simply am just trying to get the column total of total cost but am stumped at this point.

 

any help is appreciated

 

 

alexglickfire_1-1724335338864.png

 

current formula:

 

PartCost x QtyOnHand =
SUM('Parts'[PartCost]) * SUM('qryForPartsQtyData'[QtyOnHand])
1 ACCEPTED SOLUTION

Woops - sorry, I missed that you had two separate tables. You can try 

TotalValue = 
SUMX(
    OnHandTable,
    OnHandTable[on-hand] * RELATED(PartCostTable[part cost])
)




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

Proud to be a Super User!





View solution in original post

7 REPLIES 7
audreygerred
Super User
Super User

Hello! You are going to want to use an interator function to handle this. I created some mock data to explain:

audreygerred_0-1724338068214.png

Here, I have the Total Cost showing as on-hand * cost at the row level in the table, but the total shows a sum of those. For this, you need SUMX in your measure.

 

Total Cost = SUMX('YourTable','YouTable'[On-Hand]*'YourTable'[Part Cost])
 
This way, the total is the sum of each on-hand* cost rather than the sum of on-hand * the sum of cost.




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

Proud to be a Super User!





Fairly new sorry if i seem real confused but here is what i am getting

 

alexglickfire_0-1724338612621.png

 

bigger look of the table/table view

 

alexglickfire_1-1724338709902.png

 

 

alexglickfire_0-1724339142419.png

not sure why it did not pull but i have gotten this far

Woops - sorry, I missed that you had two separate tables. You can try 

TotalValue = 
SUMX(
    OnHandTable,
    OnHandTable[on-hand] * RELATED(PartCostTable[part cost])
)




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

Proud to be a Super User!





Thank You!

You're very welcome!





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

Proud to be a Super User!





DataNinja777
Super User
Super User

Hi @alexglickfire ,

May I ask what the name of the field is that you are placing in the rows of your matrix table? You can try to get the total to add up by using the SUMX function over that column in the rows of the matrix table. Alternatively, you can skip the total row by applying the IF and HASONEVALUE formula

PartCost x QtyOnHand (without total) = IF(HASONEVALUE('Your table'[Column name on row]), [PartCost x QtyOnHand], BLANK())

 Best regards,

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 Kudoed Authors