Creating a measure

Marsh77

New Member
Joined
Mar 31, 2014
Messages
7
Hi all,

I am new here so apologies if this is in the wrong place.

My raw data is in this sort of format in a data warehouse so i write a query within powerpivot and get a large table (over 900k rows)

I then pivot the data add slicers etc. in the columns on the powerpivot pivot table I have a column for existing and for new. I want to add a measure that does a ratio of the two. Up until now i have to cheat and just use the excel cells to the right of the table and format so it looks like it is part of the table. However now i have been asked to rank by product so i could do with some help. Does this make sense?
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Region[/TD]
[TD]Customer[/TD]
[TD]Product[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]01/01/2013[/TD]
[TD]UK[/TD]
[TD]Existing[/TD]
[TD]A[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]02/01/2013[/TD]
[TD]UK[/TD]
[TD]New[/TD]
[TD]A[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]03/01/2013[/TD]
[TD]UK[/TD]
[TD]Existing[/TD]
[TD]A[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]04/01/2013[/TD]
[TD]UK[/TD]
[TD]New[/TD]
[TD]A[/TD]
[TD]x[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
The above is a simplistic example. I am struggling as its not one columns of my raw data divided by a different column of my raw data. I cant see anything that lets you do it if its a result within a column spread over a number of colmuns within the pivot table
 
Upvote 0
Assuming Table1 is where you are storing in this data. I included the IFERROR statement to ignore the 5/0 ratio.


=IFERROR(COUNTROWS(FILTER(Table1,Table1[Customer]="New"))/COUNTROWS(FILTER(Table1,Table1[Customer]="Existing")),blank())
 
Upvote 0

Forum statistics

Threads
1,223,992
Messages
6,175,822
Members
452,672
Latest member
missbanana

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