DAX / PowerPivot - Handling Changing Sales Rep Targets When Promoted - excel

I am fairly new to DAX / PowerPivot but have built a nifty Sales Dashboard which is working well. Once combined with the PowerUpdate utility and Office365 PowerBI we will have a awesome solution. I'm excited!
One final thing that I am struggling to get my head around, is how we handle changing targets/budgets when a Sales Rep is promoted, as we assign budget by Job Level.
Let's say we have Sales Rep A - Junior Sales Rep with a target/budget of 30K per Quarter and they they get promoted in Q2 to Mid-Level with a target/budget of 45K per Quarter.
In my current dashboard, as soon as the Job Title is changed, this changes historical budget to the new target which warps any historic performance.
We have too many Sales Reps to create a quarterly budget table rows entry for each Sales Rep and each Quarter which seems to be how all the examples out there handle it - i.e:
Sales Rep A | 2015 | Q1 | 30000
Sales Rep A | 2015 | Q2 | 45000
Sales Rep A | 2015 | Q3 | 45000
My initial thoughts were to add a new user to the User Table with the same name and a "Budget Valid To" date and calculating target based off those dates.
Sales Rep A | Junior Sales Rep | 30000 | 01/01/2015
Sales Rep A | Mid - Sales Rep | 45000 | 01/04/2015
I just can't get my head around how I would handle this in a DAX calculation and I can't help thinking that there must be a more elegant way of handling this anyway! I'm so close to delivering this it tingles.
Let me know if you need an example or more detail.
Cheers,
Ben

Not sure the granularity of your data (daily | weekly | monthly). But one idea that could work well is to divide the target by the granularity so you're effectively pro rating the target. Then you can use basic SUM functions at each quarter boundary to show accurate targets since the sum of the 'daily' targets would equal your hard coded targets. You'd need to be careful if your periods vary in number of days... dividing into months would make it uniform; but mid month promotions would still be hard. HTH.

Related

Cognos 11.0.13 DMR crosstab, how to set the drill through for the correct year when there are two facts -- Current Year Sales and Prev Year Sales

How can I pass the correct year in the drill through?
When using a list - each column can have it's own drill
In a crosstab, the drill through appears to be the same for all cell values (showing metrics)
In this example, the crosstab has two metrics -- current sales and prior year sales
They are stitched by company and year
The join for prior year sales is based on Year -1, this way the Report can show a specific Year (like 2019) and the facts adjust accordingly (i.e. Current year sales is for 2019 and prior year sales 2018, even though the crosstab shows 2019 for the year). The metrics display correctly
Because of this approach (using a crosstab), the facts share the same drill through
How can I pass the correct year in the drill through?
I have the drill through using the Year and sales rep. Because of this the drill through shows the selected year, EVEN when selecting the metric for prior year
Crosstab looks like this
| Year (like 2019 |
| Month (like 9) |
|Sales|Prior Year Sales |
Sales Rep|456 | 123 |
|523 | 0 |
|623 | 123 |
Drill through pass data item -- Sales Rep, Year (which works)
However, when selecting prior year, the drill through is passing 2019
Reminder, in a list, each column has a separate drill through
Btw: If I try to change the list to a crosstab, I lose the drill through definitions
So I can't say I fully understand how you are getting your prior year, I fear with 2019-1 and stitching joining items, you maybe getting out of MDX(DMR) functionality and in to SQL(Relational) contexts.
If you are using DMR and have the current Year projected on an edge, you could get the previous year via the lag function, more complex dynamic functions such as parallel period also exists.
Does the drill behavior change if you project the 2019 member and a calc of lag(2019) projected next to it?

Can an IF/AND + INDEX/MATCH formula pull values based off multiple criteria?

Lets say I have a table in sheet 2:
my headers go
Program | start year | Salary | meets some expectations | meets all expectations
business | 2017 | $50,000 | $0 | $1,000
finance | 2016 | $60,000 | $0 | $2,000
treasury | 2015 | $80,000 | $0 | $5,000
In another sheet (sheet1), I have a roster where I need to pulls in salary data based on that table. So, if employee 1 in row 1 has a start year of 2015, it'll pull over her planned salary of $80,000. Employee 2 in row two started in 2017, so their planned salary will be $50,000.
how can I use an index/match to pull over the correct planned salary? I feel like this is a long-winded IF statement to trigger an index/match value, but I don't know where to start.
Second part to this, how can I implement an IF statement to pull over the incentive numbers?
example:
employee 1 business 2015 meets all expectations would receive a $5,000 incentive.
This table I made has only one business segment, there are dozens, so I'm sure that would factor in. Can this be done?
With the data you gave in your example, this formula can work (enter with CTRL+SHIFT+ENTER):
=INDEX($A$2:$E$4,MATCH(B7&C7,$A$2:$A$4&$B$2:$B$4,0),MATCH(D7,$A$1:$E$1,0))
I don't think you need multiple criteria to simply pull through the salary.
Can you not just do this:
=INDEX($K$5:$K$7,MATCH($D4,$J$5:$J$7,0))
To get the incentive value based on start year AND performance, you can use an INDEX/MATCH/MATCH:
=INDEX($L$5:$M$7,MATCH($D4,$J$5:$J$7,0),MATCH($F4,$L$4:$M$4,0))
EDIT: To allow for different programs without an array formula:
=INDEX($L$5:$M$7,MATCH(1,INDEX(($C4=$I$5:$I$7)*($D4=$J$5:$J$7),0,1),0),MATCH($F4,$L$4:$M$4,0))
The trick here is in first MATCH formula, which checks both the Program and Start Year:
MATCH(1,INDEX(($C4=$I$5:$I$7)*($D4=$J$5:$J$7),0,1),0)

Add turnover column to my pivot table using PowerPoint

I am using powerpivot to create some metrics. On one pivot table, I want to show hires, terms and actives and then turnover % for each month.
I have the Hires, Terms & Actives powerpivot data working, however I do not know how I can add the turnover calculation.
Is there a way to insert a new column to a pivot table and run a simple division calculation in it?
*tried posting image of my data, not sure why site will not post image for me
one line of of table would look like such
Division | Hires | Actives | Terms | Turnover
Corporate | 5 | 150 | 3 | (terms/actives)
You can do this with the following measures:
SumActives:=
SUM(<fact table>[Actives])
SumTerms:=
SUM(<fact table>[Terms])
Turnover:=
[SumActives] / [SumTerms]
Adding a measure to a Power Pivot model.
Upon researching I found this thread on MrExcel that solved my question!
First create a measure
ValueSum:=SUM(Table1[Value])
then create a measures that takes the average of the monthly totals of the previous measure.
=AVERAGEX(VALUES(Table1[Month]),[ValueSum])

How do I represent sums at different levels in Cognos 8?

I'm writing a report in Cognos. I want to represent all outstanding values for clients. This includes time we've worked but not billed (Unbilled) and unpaid invoices we've billed. Unbilled is a summed value with only one line. Invoices may have multiple lines as I want to keep the invoice number detail.
Unbilled Outstanding
-------- -------------
client Fees | Costs invoice | invoice Date | invoice amt
ABC $100 $25 B989 10/10/2013 $200
DD89 05/19/2013 $400
87R 07/14/2013 $300
XYZ $11 0
LMN 0 0 TRT11 01/01/2013 $500
Is this the best way to represent this, and if so, how do I do it? If not, how?
Thanks.
I found a document that explained it. The document is called Multiple Aligned Column Headers In Lists and Crosstabs. I found it on the IBM Developer Works website.
HTH

Current price by cumulative progress against discrete values

I have to implement a set of formulas in Excel whose requirements seem to defy any logical or succinct way to do them with just formulas.
Short Description:
determine (and display) a timeline of a product's "effective" internal cost each day based on 1) the price paid for the product as a series of bulk purchases, and 2) the company's per-day consumption of the product using the price paid for each purchase, until the purchased amount is consumed and then moving on to the next purchase.
Simplified Details:
We have a sheet "PurchSums" with the product's bulk purchase history: (this is actually a pivot table)
| A | B | C | D |
1: Product Name Purch Date Rate Amount
...
23: Prod-Q 12/18/2012 $3.15 123.7
24: 1/24/2013 $3.05 748.2
25: 2/27/2013 $2.86 650.0
... ...
So initially, the internal price should be $3.15/pound until the first 123.7 pounds are used us, then it should switch to $3.05 and so on.
We have a sheet "Volumes" with consumption by day: (product consumption starts on March 1st)
| A | B | C | D |
1: Product Name 3/1/2013 3/2/2013 3/3/2013 ...
...
12: Prod-Q 87.2 77.1 101.5 ...
... ...
And I need to fill in formulas for the daily price sheet "Prices", which has the product's effective internal price for each day (filled-in by hand now):
| A | B | C | D |
1: Product Name 3/1/2013 3/2/2013 3/3/2013 ...
...
32: Prod-Q 3.15 3.15 3.05 ...
... ...
Note here that the price for "Prod-Q" changed to 3.05 on March 3rd. This is because its cumulative consumption reached 265.8 pounds (87.2 + 77.1 + 101.5) which exceeded the 12/18 purchase of 123.7 pounds and so switched from its price of 3.15 to the price of the next purchase from 1/24.
More Details:
The first sheet "PurchSums" is actually a pivot table, if that helps. Unfortunately, I don't think that it does, nor that GETPIVOTDATA(..) is going to be useful here (but I would be happy to be wrong). The information in it comes from another sheet "Purchases" which is just a list of all of the purchases:
| A | B | C | D |
1: Product Name Purch Date Rate Amount
...
11: Prod-Q 12/18/2012 $3.15 123.7
...
34: Prod-Q 1/24/2013 $3.05 748.2
...
67: Prod-Q 2/27/2013 $2.86 650.0
...
Additional:
First, I would like to do this as much as possible with Formulas in the existing cells/sheets. Plus I would like to minimize the number of additional sheets that have to be added to support this, as the workbook is already pretty substantial.
Secondly, yes I know that I could do this with VBA functions, and I will do that if there's no better way, but I would like to avoid that if possible because in my experience, populating the formulas of large sheets with massive VBA function calls can lead to some significant performance issues.
I would be grateful for any ideas on how to effectively approach this.
So what you are describing is a FIFO inventory accounting system. First In First Out. You might want to read up on it here:
http://en.wikipedia.org/wiki/FIFO_and_LIFO_accounting
and here:
http://accountingexplained.com/financial/inventories/fifo-method
Basically under FIFO you are making the assumption(whether right or wrong) that the first items that you are adding to your inventory are the first ones you are going to use up in your production. As opposed to LIFO which makes the assumption that the last items that you add to your inventory are the first ones that you are going to use up. That would only require a small change in my solution but let's focus on FIFO since that is your question.
So for every day that you operate you need to figure out how much of your inventory you used up and how much you paid for that inventory. So if you bought 20 items at 50 dollars and then another 20 items at 100 dollars the next day - and on the third day you used up 30 of the items in production, you used up (20 * $50 ) plus ( 10 * $100 ) = $2000 worth of inventory. 2000 / 30 = your effective cost of the product for the day(66.6666667). This effective cost is purely informational for the day - you probably wouldn't want to use it for any accounting - although you could with some rounding corrections - it would just be an indirect way to go about it.
So my solution uses a really ugly table. Basically for every day that you operate you need to figure out how much of your inventory you are using up and how much you paid for that inventory - and then divide it by the total amount used up in the day. Something like this should work for you:
=(IF(AND($E8>G$4,$E8>G$5),G$3,0)+IF(AND($E8>G$4,$E8<G$5),($E8-G$4),0))-SUM(G$7:G7)
=(IF(AND($E9>G$4,$E9>G$5),G$3,0)+IF(AND($E9>G$4,$E9<G$5),($E9-G$4),0))-SUM(G$7:G8)
=G8*$C8
=SUM(G13:G15)/G3
These formulas are all auto-fillable. And you could add on to this table as much space as you need(and probably improve it quite a bit). A small program in almost any language could accomplish this much easier and more intuitively than excel - but this works fine.
In practice, oftentimes nobody really knows which pieces of inventory are being used up and thus how much you paid for them. But the system persists nonetheless - usually the reason many accounting practices are done are the same as why the ancient peoples of the earth sacrificed animals - because that's how it's always been done - tradition and folklore. And for the most part it serves them quite well - routine sources of protein are healthy. I could think of some better ways to do it but - alas. Good Luck.
Assuming you know how to:
display product names on every row from the pivot table
extract lower- and upper-bound interval points from the Amount values from the pivot table
sum Volumes from all previous days from the correct row for each product
cover edge cases like volumes outside defined amount intervals
use Office 2007+ tables
use named ranges
...
For the first day, you want the maximum price = the first row for a given product name:
=INDEX(PurchSums[Rate], MATCH(this_row_product_name, PurchSums[Product Name], 0))
For every other day, you want to sum Volumes from all previous days and extract the rate from matching interval of Amounts for a given product name:
=SUMIFS(PurchSums[Rate],
PurchSums[Product Name], this_row_product_name,
PurchSums[Amount above], TEXT(sum_of_previous_volumes_for_product, "<=General"),
PurchSums[Amount up to], TEXT(sum_of_previous_volumes_for_product, ">General"))
Note that sum_of_previous_volumes_for_product > PurchSums[Amount above] and all the other conditions should be met in 1 row only, so we sum exactly 1 row.
Example:
For cell E16 the named ranges would be replaced / point to:
this_row_product_name = Prices[[#This Row],[Product Name]] = Prices[#Product Name] = $B16
sum_of_previous_volumes_for_product = =SUM(OFFSET(Volumes[[#Headers],[2013-03-01]:[2013-03-02]], MATCH(this_row_product_name, Volumes[Product Name], 0), 0)) = SUM($C12:D12)
So basically you want to summarize your "PurchSums" sheet and "Volumes" ones into one that combines the date fields??
If this is the case....
In your summary sheet make a row filled with the dates
Make a column for Purchase amount
Make a column for Volume amount
Under the Purchase amount use a match / index formula like this:
=index({Select the column C from "PurchSums"},match( {Select date from third sheet},{Select date column from "PurchSums"},0))
Similarly do the same thing for the Volume column.
Hope this gets you on your way if I am not far off on what you are trying to accomplish.

Resources