Excel 2013 PowerPivot create category

maxwell888

New Member
Joined
Jun 2, 2016
Messages
6
I have a dataset which contains two fields and data similar to below.

I can create a powerpivot table as per below
a75
b151

<tbody>
</tbody>

How can I create an extra category? - type c which is calculated from the other two - i.e. c = 2*a + 2*b

Note that in PowerPivot table tools -> analyse -> Fields, Items and sets, - Calculated field and calculated item are greyed out.
a75
b151
c452

<tbody>
</tbody>





Dataset
TypeCount
a43
a32
b76
b54
b21

<tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
If you select a row label first, then you can add a calculated item c as 2 * a + 2 * b.
 
Upvote 0
Yes and next, in Excel 2016: select Pivot table context menu - Analyze - Fields, Items & Sets - Calculated Item.
Name = c
Formula = 2 * a + 2 * b

By the way: this is rather an Excel question than a Power BI question.
 
Upvote 0
Yes and next, in Excel 2016: select Pivot table context menu - Analyze - Fields, Items & Sets - Calculated Item.
Name = c
Formula = 2 * a + 2 * b

By the way: this is rather an Excel question than a Power BI question.

Yes, my post was moved from the excel forum to the powerbi forum :)
The calculated item is greyed out for me - I believe because I am using the data model to store my data. It seems like that is my real problem.
 
Upvote 0
Oops, I see.
In that case my suggestion would be to add a calculated column to your table in the datamodel and measures to sum the values.
the formula for the calculated column is: =if([Type]="a",2*[Count],if([Type]="b",2*[Count]))

If the calculated column name is "c-values", then, for the measure: c:=SUM(Table1[c-values])
And another measure for the sum of all counts: SumCount:=Sum(Table1[Count])

Now you can use these measure in the values part of your pivot table, which will put the results in columns.
I don't think it would be possible to have your c-values in an additional row.

Please note I'm not at all a DAX-expert, but as far as I know, this would be a proper way to do this.
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,681
Members
449,048
Latest member
81jamesacct

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