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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
sterry
New Member

Product function in calculated column or measure

How do I add a calculated column that simply is the product of the values in two other columns (Qty on Hand X Unit Cost)?  Seems like it should be easy enough to do, but I'm struggling with it...  Thanks in advance.

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

Load your PBIX, and go to your Data and go to the table where the columns are. Click "New Column" and enter the formula:

 

Inventory Cost =[Qty on Hand] * [Unit Cost]

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

@andre  @Seth_C_Bauer  Instead of calculated column can use Measure:= SUMX( TableName; TableName[Qty on Hand] * TableName[Unit Cost] )  so you can iterate the whole table like a calulated column.

Konstantinos Ioannou

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

Load your PBIX, and go to your Data and go to the table where the columns are. Click "New Column" and enter the formula:

 

Inventory Cost =[Qty on Hand] * [Unit Cost]

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Perfect.  Thanks.  That's simple enough.  I was convinced that I had to use some type of built in function to do a calculation.  

@Seth_C_Bauer i am afraid in this particular case your measure calc will not work.  I am not a big fan of calculated columns but in this case, I think that smoupre's solution will work better.

@andre - Whoop, glossed over this one a little to quickly. Yep, you're right. Thanks for pointing this out.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG
Seth_C_Bauer
Community Champion
Community Champion

you can do this by building up a final measure by utlizing two hidden measures.

 

Create and Hide these measures

Measure1 := SUM([Qty on Hand])

Measure2 := SUM([Unit Cost])

 

Final measure

Measure3 := Measure1 * Measure2


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

@andre  @Seth_C_Bauer  Instead of calculated column can use Measure:= SUMX( TableName; TableName[Qty on Hand] * TableName[Unit Cost] )  so you can iterate the whole table like a calulated column.

Konstantinos Ioannou

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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