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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Chalklands
Helper I
Helper I

Trying to add a calculated column into a table

Hello,

Sorry if this is a very simple question, but hope somebody can help me.

 

I'm trying to add a new calculated column in a table to calculate 'Total Cost Of sales'. The formula I have is:

 

= ["Quantity_Ordered]  * [Standard_Cost_Per_Case]

 

The formula is accepted but every line calculates to 0

 

What am I doing wrong? I'm new to Power BI and am basically an excel user. It the syntax of the formula wrong?

 

Hope somebody can help?

 

Thanks

 

Pete

1 ACCEPTED SOLUTION

Thanks Johanno.

 

My fault!

I think the problem is not BI related but the raw data source.....One of the columns has not been populated yet for September, so is appearing as 0. Obviusly anything multiplied by zero = zero!!!!

 

 

Pete

View solution in original post

4 REPLIES 4
Johanno
Continued Contributor
Continued Contributor

It should work for both when it's in the same table, but I think best practise is to also specify the table names in the formulas and not only the column name e.g. Total=TableName[Quantity_Ordered]*TableName[Standard_Cost_Per_Case] 

Also, I note that you have a " before Quantity if that has something to do with it.

 

Thanks Johanno.

 

My fault!

I think the problem is not BI related but the raw data source.....One of the columns has not been populated yet for September, so is appearing as 0. Obviusly anything multiplied by zero = zero!!!!

 

 

Pete

MattAllington
Community Champion
Community Champion

It’s hard to say why you are getting zeros, but have a look at my article here. 

 

https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/

 

There is a lot of beginners info here https://exceleratorbi.com.au/knowledge-base/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thanks Matt

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.