SSAS Grand Total is wrong because get value from Calculated member - excel

I have 2 Calculated Member AVG Weekly Percentage and AVG Monthly Percentage.
For weekly the Result is Good
And for AVG Monthly Percentage there is error on Grand Total because there is the addition of a grand total of AVG Weekly percent.
the real result AVG(99.83%+85.59%+99.80%+100%+100%+100%) = 97.54%
but the Result from Cube (AVG(99.83%+85.59%+99.80%+100%+100%+100% + 100% (from weekly grand total)) = 97.89%
For AVG Weekly Percentage
IIF(
isempty([Measures].[Actual Quantity MTD]) or [Measures].[Actual Quantity MTD]=0 or isempty([Measures].[Original Plan Quantity MTD]) , null ,
IIF([Measures].[Original Plan Quantity MTD] =0 or
isempty([Measures].[Original Plan Quantity MTD]),null,
IIF(
([Measures].[Actual Quantity MTD]-[Measures].[Original Plan Quantity MTD]) > 0 , 1 ,[Measures].[Actual Quantity MTD]/ [Measures].[Original Plan Quantity MTD]
and for AVG monthly Percentage
AVG (
DESCENDANTS([PSL Scenario].[PSL Scenario Description])*
DESCENDANTS([Plant].[Plant])*
DESCENDANTS([Finish Date].[Calendar],[Finish Date].[Calendar].[Month Year])
, AVG(([Finish Date].[Calendar].CURRENTMEMBER.CHILDREN), [Measures].[AVG Weekly Percentage]))
What do i miss?

You may have to exclude the 'weekly grand total' (as you call it) from the calculation.
I have had situations like this, where I tell the calculation to only use values if they are from the leaf level (or a particular level) of the hierarchy. Can you do this?

Related

How to calculate GM% with multiple sales on the same date into unique dates?

I'm given gm%, gm&, sales, sales cost, and several of the same dates. For every date, I want to find the total Gross Margin Percentage for that day. How can I do that in Excel? I want my output to list a unique date and the GM% corresponding to the date.
You can't average gross margin percentages and get an accurate figure. You need the total cost and total retail (/selling price) amounts, and with the total cost and retail amounts you'll be able to calculate the average gross margin percentage with 1-Sum([Cost])/Sum([Retail]).
Averaging percentages is not accurate reporting. Proof:
Units Cost Retail GM%
10 379 1000 62.1%
1 327 650 49.7%
The "average" GM% you would be aggregating would be 55.9%...
but the correct GM% would be 57.2%.
If all you have is the total sales amount and the GM%, you need to compute the total cost:
[Cost$] = [GM%]*[Retail$]
If all you have is the total cost amount and the GM%, you need to compute the total retail:
[Retail$] = [Cost$]/(1-[GM%])
If you have the GM$ amount and the GM%, you can calculate both cost and retail amounts:
[GM%] = [GM$]/[Retail$]
[GM$] = [Retail$]-[Cost$]
[Retail$] = 1/[GM%]*[GM$]
[Cost$] = 1/[GM%]*[GM$]*(1-[GM%])
With these, you can now accurately compute the average GM% figure.

DAX/Power Pivot: Calculate 75% Expended Date from Cumulative Total

I have three tables that contain cost: Forecasted Cost, Actual Costs, Invoiced Costs. Each has an "EAC Filter" column for a Y/N of whether to include the cost in an Estimate at Completion, which automatically changes over time and/or as data is added. Here are examples:
EAC from the three tables can be calculated as follows:
Total Cost = Sum(Forecast[Cost])+Sum(Actual[Cost])+Sum(Invoice[Cost])
EAC = Calculate([Total Cost],EAC_Filter[EAC Filter]="Y")
I have a budget at the "Account" level, which could also be rolled up to a "Dept" level budget.
I need a measure for my Power Pivot table which will display the week at which costs have exceeded, or are forecasted to exceed 75% of the budget, using some sort of a cumulative cost, combined with the max week where cumulative cost >= .75 * Budget.
The weeks are numbered through the year as follows:
Thanks for your help!
Given an EAC measure which sums the cost per week,
EAC = CALCULATE(SUM(Forcast[Cost]) + SUM(Acutal[Cost]) + SUM(Invoice[Cost]),
EAC_Filter[EAC Filter] = "Y")
You can create a Cumulative Cost measure as follows:
Cumulative Cost = CALCULATE([EAC],
FILTER(ALL('Calendar'), 'Calendar'[Week] <= MAX('Calendar'[Week])))
Using this, we can create a measure that predicts the week the cost exceeds 75% of the budget:
75% Week = MINX(FILTER(ALL('Calendar'), [Cumulative Cost] > 0.75 * SUM(Budget[Budget])),
'Calendar'[Week])
Here's what the relationships structure looks like:

PowerPivot Grand Total, Sum of all change in %s?

So I am working on a report that has to show total 'pts' in a table based on the performance of certain groups of work.
Right now I have a PowerPivot that Sums Actuals, Forecasts, and the Variance. Then I have separate formulas that filter on each group so that I get a variance % based on each group.
Example formula - 'Group1 Acc:=ABS(CALCULATE(([Actual]-[Forecast])/[Actual],talbe[name]="Group 1"))'
I want the table to look like this....
Column Group 1 Group 2
Criteria 1 25% 25%
Criteria 3 20% 20%
Criteria 4 10% 10%
Grand Total 21.2% 55%
Group 1 is how it is currently working and makes sense to me but isn't doing what I want. It is getting the weighted % change of all the groups. Total Actual-Total Forecast/Total Forecast basically. In this example it comes out to 21.2% because Criteria 4 had a larger % of the total Actual and Forecast for the time period I am comparing.
I want it to work like it is showing in Group 2. The SUM of the total %s over each criteria group. I've tried SUMX formulas, Value(), and such but can't figure this out. Any help would be appreciated.
Thank you!
Check out this article: Subtotals and Grand Totals That Add Up “Correctly”
Basically, you can create logic so that the total behaves separately from the individual rows. Something along these lines:
Measure =
IF(COUNTROWS(VALUES(Table1[Criteria])) = 1,
[Group 1 Acc],
SUMX(VALUES(Table1[Criteria]), [Group 1 Acc])
)
Data:
Type Actual Forcast
Criteria1 33 32
Criteria2 543 345
Criteria3 643 633
Criteria4 45 65
Criteria5 7890 7999
MEASURE 'datatable'[SumOfActuals] =
SUM ( 'DataTable'[Actual] )
MEASURE 'datatable'[SumOfForcast] =
SUM ( 'DataTable'[Forcast] )
MEASURE 'datatable'[Group1] =
DIVIDE (
'datatable'[SumOfActuals],
CALCULATE ( 'datatable'[SumOfForcast], ALLSELECTED () )
In Excel, filter for Criteria 3 and 4
Row Labels Group1
Criteria3 92.12 %
Criteria4 6.45 %
Grand Total 98.57 %

how to calculate in excel multiple taxes on amount of money?

I want to make a function in excel program to calculate multiple taxes.
x=main salary = 30000 as an example.
then >>
I divide the x into 10000s
the first 10000 in x has no tax,
the second 10000 in x has 10% as tax,
more than that has 15% as tax
I need
main salary - taxes = real salary.
The Formula for the Tax is:
=IF(A1-10000>0,IF(A1-20000>0,(A1-20000)*15%+(10000*10%),(A1-10000)*10%),0)
A1 the initial salary
In case the salary is <= 10000 no Tax it returns 0
If will test
In case A1-20000 >0 True will apply 15% on A1-20000 + 10000*10%
In case A1-20000 <=0 10% will be applied to A1-10000
The result will be the Total Taxes

how Calculate Margin in GP

I want to Calculate profit margin from Dynamics GP Database.
Which fields or table been used. and How Can I do that.
If any one have an idea please share with me.
In general, there are many different ways to calculate gross profit margin. Be sure you are using the method which is accepted by your companies accounting policies.
Here is an example which looks at all invoices which have been posted year to date and calculates the gross profit margin percentage.
Assuming gross profit margin = total profit / total revenue.
SELECT ( SUM(SUBTOTAL) - SUM(EXTDCOST) ) / SUM(SUBTOTAL)
FROM SOP30200 t1
WHERE t1.SOPTYPE = 3
AND t1.DOCDATE BETWEEN '1/1/2013' AND GETDATE()
This will return a decimal number like .44323. In that case you would be making an average gross profit margin of 44% for every invoice year to date.
SOP30200 = posted sales transaction documents

Resources