.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to Define a "Total" to Calculate Percentage for SKU in PivotTable?

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Sql Server

Let's take a look at a sample PivotTable below:


SKU     $     NewMeasure

111     5      30 (5+ 10 + 15)

222     10     30 (5+ 10 + 15) 

333     15     30 (5+ 10 + 15)

SKU     $     NewMeasure

111     5      20 (5+ 15)

333     15     20 (5+ 15)


How do I go about defining the "NewMeasure" calculated member in my AS2008 Enterprise cube?  The NewMeasure should essentially be the total $ amount for all SKUs in the current PivotTable.

What I'm really after, in this particular example, would be the percentage of a given SKU's $ amount relative to the total $ amount for all SKUs in the current pivot.  I figured if I can get the "NewMeasure" logic figured out, the above would be easy.

In summary, my goal is:

SKU     $     NewMeasure         NewMeasure2

111     5      30 (5+ 10 + 15)    5/30


View Complete Post

More Related Resource Links

Use one cell`s value onto aother Cell to calculate percentage in SSRS 2008


Pls help me with my below issue.


I developed SSRS 2008 Matrix Report.

In one of the Rows in the Matrix, First Rows Represent Percentage of Subtotal of Second Rows's Value.In my Matrix , total i have 4 Rows, one of Row need to show a Percentage of Subtotal of Another Row.

How can i Reference that Row Values / Matrix subtotal Values Like that ?

Below is formate of my Matrix SSRS 2008 Report.

Jan Feb March

Mumbai 48% 51% 41% <---Represent of Second Row - Bangalore Percentage of Subtotal

Bangalore 135 192 197

Delhi 149 185 278

Total 284 377 485

How can i reference, One Cell Value from other Cell's and Subtotal for the Percentage Calculation in SSRS 2008 Matrix ?

I would like to calculate percentage for banglore. Such as 135/284.. do you kno what i mean.

Please help me!!

Let me know if need information.



Calculate total sum



I have following table named example sales:

Id         Name         Price 

1             a1               4

2             a2               7        

3             a3               1

4             a4               3 

I whant to calculete total sum of price this will be 15 and after that create new column wich will have following formula Total Sum of price - price,

example for first columnt 15-4=11 and the result must be:

Id         Name         Price       new_column


How to display/calculate total of a custom column in dataview webpart's grouping header



I've created a dataview from a MOSS2007 form library. In the dataview, I've enabled grouping by a specific column and also was able to show the total (sum) of couple of columns like this, in the group heading:

<xsl:value-of select=”sum($nodeset/@Total_x0020_Cost)” />

So far, it's working fine. I've added couple more columns to this dataview. There's a piece of javascript code that is executed for each row. These 2 columns gets their value from this javascript. Now, is there anyway, I can get the total/sum of these columns in the group heading.

Have you done something like this? Please advise.




How to calculate max,minaverage and total in ssrs matrix report



   in SSRS 2005 matrix report, i would like to do following thins

1- Calculating Max,Min,agerge and Sum for each Row.

2- i have to put this calculated result   before matrix column group.

i have 4 row groups in my report. i am expecting report like this:


Country   State   City    Dealer      Min Max Agerage Total 1-oct-2010  2-oct-2010    ......


here first four columns i have created as row and Date as matrix column this is dynamic based on rage selected from parameters.

 Please help me on this.




How do I calculate Runningvalue percentage


How do I calculate the running value percentage in a matrix

The Cumulative Frequency has been calculated as   =runningvalue(fields!recordcount.value,sum, nothing)

The Cumulative Frequency % is what I did not know how to calculate. 

Below is detailed view of my report

the field in my table for total record count is recordcount the other 3 are calculated fields on the report

How to calculate the total of wpf datagrid text column



I have WPF DataGrid that is bound to and entity.

The DataGrid has a "Difference" column that is computed from the difference between two other columns in the same DataGrid.

Now I have a TextBox outside the data grid that should contain Sum of all cells in the "Difference" column.

How do I do that?


<DataGrid AutoGenerateColumns="False" HorizontalAlignment="Stretch" Margin="5,35,150,40" Name="BoxCountDataGrid" VerticalAlignment="Stretch" ItemsSource="{Binding UpdateSourceTrigger=PropertyChanged, Path=DemersalBoxCounts}" >


                              <DataGridTextColumn.HeaderTemplate >
                    <TextBlock Text="Recorded Box Unit/Weight(kg)" Width="70" TextWrapping="Wrap"/>

              <DataGridTextColumn Binding="{Binding DEBC_BCT}" Width="*">
                <DataGridTextColumn.HeaderTemplate >
                    <TextBlock Text="Box Count" Width="70" TextWrapping="Wr

How to calculate total work hours between dates?

I am in the process of creating a calendar.  This calendar is to track leave hours for employees.  For example if a person takes leave for 2.5 days then the formula would calculate 8hrs per day and 4 hours for half a day = 20hrs.  I have part of the formula I believe "=TEXT([End Time]-[Start Time],"h")".  The problem is that it does not count multiple days and just not working right. Any advice would help.

How to calculate total hour and minutes within time range


I need to prepare a yearly management report to show the total overtime (OT) work hours and minutes of all staff within time range and month.


The time format in database is as follows:

Each record will contains the FROM date & time and TO date & time


The report layout is as follows:



I had no idea how to divide and calculate the total hours & minutes within the time range as each OT records will overlap several time range and date.

Please help. Thanks.






Calculate distance, bearing and more between Latitude/Longitude points

This page presents a variety of calculations for latitude/longitude points, with the formulæ and code fragments for implementing them.

All these formulæ are for calculations on the basis of a spherical earth (ignoring ellipsoidal effects) - which is accurate enough* for most purposes. [In fact, the earth is very slightly ellipsoidal; using a spherical model gives errors typically up to 0.3% - see notes for further details].

How to calculate the distance between two points on the Earth

We offer many Global Database Products that you can use with the below formulas to calculate distances and many other uses. Not sure how to use distance calculations or global databases within your company? See our Global Database Examples for more information on how to use our data within your industry. Be sure to Download a Free Sample of one of our many Global Database Products.

Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

Logic to calculate business hours


Hi All,

I have tried searching all over the web for this logic. Got many but half of them did not match what i was looking for and half were malfunctioning.

I want to calculate business working hours between 2 datetime, where in I should be able to set the working hours as well as weekends and holidays should not be calculated.


Please help me guys... It will be a great help... 

UDP Delivers: Take Total Control Of Your Networking With .NET And UDP


UDP, the lesser-known sibling of TCP, is used for DNS resolution, SNMP network status, Kerberos security, digital media streaming, VoIP, and lots more. Learn how to put UDP to work for you.

Yaniv Pessach

MSDN Magazine February 2006

Calculate Client Height in javascript

The article Calculate Client Height in javascript was added by amoljk2009 on Monday, May 31, 2010.

Hi, Following code will help the developer to calculate exact client height in all browsers.script language="javascript" type="text/javascript">var winW = 630, winH = 460;if (parseInt(navigator.appVersion)>3) {if (navigator.appName

MVC3: Define Dynamic ViewModel property inside Action Filter



How can I define a Dynamic ViewModel property in MVC 3 inside an action filter?

I am looking to have something like but inside the ActionFilter and not in the controller:

ViewModel.Title = "Home";

Thank You,


Total newbie question: Calling jQuery in an UpdatePanel?



Please forgive this ignorant question - I've used ASP.NET AJAX a good deal but I'm new to jQuery.  Specifically, is it possible to call or create jQuery events on the fly via an UpdatePanel?  For example, calling a jQuery modal or animating a Label (or <div> contained Literal), etc.

If anyone has any advice or could point me to some easy tutorials on mixing ASP.NET AJAX and jQuery, I'd greatly appreciate it. 



calculate fields in a list



how do I go about generating formulas for something like this.

I have a field( choice ) that has three choices (Low, Medium and High ). If I choose Low, I need to add 5 days to the current date( excluding weekends ) and place it in the Target date field, the same goes for Medium = 3 days( exclude weekends) , High = 1 day, exclude weekends.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend