Power BI Measure - calculate on two columns in same table

M1donne

New Member
Joined
Apr 7, 2014
Messages
44
Hi there

I'm trying to create a measure using two columns in the same table..

I'm trying to sum two columns

Total days = sum(Table1[Metric]+Table1[Metric2])

However I'm getting the following DAX message...

The SUM function only accepts a column reference as an argument.

I'm new to PowerBi and Dax - can someone please point me in the right direction?

Much appreciated

Md
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
SUM can only take one column at a time, so you have to use:

Total Days:=SUM(Table1[Metric])+SUM(Table1[Metric2])
 
Upvote 0
Thank you

I'm still getting the same error message, even when I use multiple sums as below

Total Days = SUM(Table1[Metric]) + SUM(Table1[Metric2])

I'm confused - could it be due to both Metric and Metric 2 are Sigma calculations?

regards
 
Upvote 0
What do you mean by:
could it be due to both Metric and Metric 2 are Sigma calculations?

Are [Metric] and [Metric2] columns or measures? If they are measures, then you do not need to refer to Table1 or use SUM:
Total Days:=[Metric]+[Metric2]
 
Upvote 0
Hi there

They are both columns, the Sigma sign to the right of the column name (in the fields section of the screen) - can you please confirm what that means?

I appreciate your help :)
 
Upvote 0
Hi there

They are both columns, the Sigma sign to the right of the column name (in the fields section of the screen) - can you please confirm what that means?

I appreciate your help :)

Alright, so if it has a sigma sign next to the field in the PivotTable field list, then it is a measure, not a column. You cannot use it in a SUM function. If you want to add them together, just use [Metric]+[Metric2]. You'll want to be sure you know what the measures are doing so that you get the expected result.

I'm assuming you didn't create the measure yourself. There are 2 ways to see what the measure is doing:

1. If you are in the Excel Window --> Power Pivot ribbon --> Measures --> Manage Measures. Then choose the measure you want to see and hit edit. That will show you the DAX code behind the measure and allow you to edit it.
2. If you are in the Power Pivot Window, then go to the table where the measure is located (under whichever table it appears in your pivot table field list) and search for it in the grid which appears beneath the table with values. You can then click on it to view and double click to edit just like you would an Excel formula.

Hope this makes sense.
 
Upvote 0
Thank you so much - my understanding of the Measure was it had a 'Calculator' Icon against it as opposed to a Sigma sign - that makes much more sense.

Much appreciated - having dabbled in Power Pivot, this is so much better.
 
Upvote 0
I'm working in Power BI as opposed to Power Pivot - does that matter re checking the Measure code?
 
Upvote 0
Sorry. I didn't see the PowerBI part of the thread title. I believe if you click on the measure in the field list, you can view the formula in the formula bar.

With respect to the calculator icon vs sigma icon, I'm not 100% sure but I believe the calculator is for a calculated column rather than a measure. But don't quote me on it.
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,908
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top