Adding YTD, YTG column to Excel OLAP Pivot - excel

I have an Excel pivot table connecting to an OLAP cube with a report looking something like
Jan Feb Mar .........Dec
Revenue 55 32 65..........45
I'd like to add extra columns YTD and YTG etc. These are already calculated measures in my cube, but when they are added to the Pivot table, not surprisingly, the months are repeated for each measure.
I just need the columns at the end like
Jan Feb Mar .........Dec YTD YTG
Revenue 55 32 65..........45 654 30
Is this possible?

I've got a solution although an inelegant one. Basically to create calculated members for Jan-Dec and uses these as columns in the report.
As I say, inelegant but client likes it.

Related

Excel Plotting two Date Ranges on the same Pivot Table

I am trying to trend the occurrence of a system event in Excel. I've attached a screen shot showing the pretty simple data that I'm working with.
The spreadsheet lists the times of the event (Column A) for a two week period and I've used a ceiling formula to group those events into 15 minute increments (Column B). Using a pivot table and chart, it's pretty simple to then take that data and graph the events into a line chart that shows the 15 minute increment time, and the count of the events in that 15 minute period.
Now I'd like to take subsets of that data and compare them. For example I'd like to compare Friday Saturday Sunday of last week Friday Saturday and Sunday of this week. So far, the only way I found to achieve this is to create duplicate pivot tables (Columns E, F and H,I), filter each table by the days I want to compare (25, 26, and 27 in one table and 1, 2 and 3 in the second), and then visually compare them (the Two charts).
But what I'd really like to do is to combine both series into one chart as a stacked line graph. I thought that would be pretty simple, but since the dates are so very dissimilar, I always wind up getting a single line or duplicate data, or totally off the wall results.
I've gotten kinda close by converting the row labels in to a custom DDD HH:MM format. That lists the Dates as (For Oct 25th)
Fri 00:15 11
Fri 00:30 1
Fri 00:45 4
Fri 01:00 3
Fri 01:15 6
Etc.
And (For Nov 1st)
Fri 00:15 7
Fri 00:30 1
Fri 00:45 2
Fri 01:00 1
Fri 01:30 2
Etc
Now I have something I can join on (Friday 00:15, 00:30, 00:45, etc is in both charts)
But the problem is, the two series often don't have the same Labels. For example the data for Nov 1 is missing 01:15,01:45 and 02:00 because no events occurred at those times. Same problem for the Oct 25th's data which is also missing 02:00 in addition to all increments between 02:30 and 03:45.
I tried just manually inserting the missing times in both charts but that quickly became a very complex and error prone chore.
So the question is: Is there a way to get excel to automatically fill in the missing time slots or am I completely off base in the way I'm trying to do this?
OK.. that was two questions :)
Thanks so much for your help!

How to count running months of a specific year?

I'm currently struggling with calculating the running months depending on the year. I have the following table:
Received Month Received Year
Feb 2018
Feb 2018
Mar 2018
... ...
Nov 2018
Nov 2018
Dec 2018
Dec 2018
Jan 2019
Jan 2019
Feb 2019
I was using this formula to count the # of unique months (running months in 1 single cell [C1]);
=SUMPRODUCT(1/(COUNTIF(KAIZEN_Table[Received Month],KAIZEN_Table[Received Month])))
This was working great in 2018, it gave me 11 (Feb - Dec).
I have to add a filter that also checks if the year is 2019. I can't remove 2018 in the table because the operators are still using the 2018 lines. The filter is just here to set a KPI for 2019.
For some reason I can't figure out how to add the year. I tried;
=SUMPRODUCT(1/(COUNTIFS(KAIZEN_Table[Received Month],KAIZEN_Table[Received Month],KAIZEN_Table[Received Year], "2019")))
This is just giving me a 0.
Any suggestions on this? VBA code is also fine.
Edit: After extensive googling I found a working formula, for whoever might be interested in this.
=SUM(IF(FREQUENCY(IF(tbl[Year]=2019,MATCH(tbl[Month],tbl[Month],0)),ROW(tbl[Month])-ROW($L$5)+1),1))
L5 = First row of tbl[Month]
I have my data in A1:B14, the formula I've used is an array one
=SUM(1/(COUNTIFS($A$1:$A$14,$A$1:$A$14,$B$1:$B$14,$B$1:$B$14)))
however,
=SUMPRODUCT(1/(COUNTIFS($A$1:$A$14,$A$1:$A$14,$B$1:$B$14,$B$1:$B$14)))
would suffice
To do a particular year, you could do something like this
=SUM(($B$1:$B$14=2019)*(1/COUNTIFS($A$1:$A$14,$A$1:$A$14,$B$1:$B$14,B1:B14)))
Another approach is to use a Pivot Table.
On the Create Pivot Table dialog, select to Add this data to the Data Model
If you do this, you will note that one of the options in the Value Field Settings will be Distinct Count
Drag Received Year to the Rows Column; Received Month to the Values column, and select Distinct Count for the Value Field Setting

Conditional Formulas in Excel 2013

Good day folks! Can you please help me with the following excel problem (Please see below)
July Aug Sep Oct Nov Dec
Total Assets (USD'K) 32 36 38 31
Current Month : (Drop-Down list for all months)
Monthly Change in Total Assets = Current Month - Previous Month
So, here is the situation:
Each month I need to new add statistics to my worksheet. For example, when new data for Total Assets in November arrives, I need to insert it above under the heading "Nov", etc.
After inserting new data, I need to select from the drop-down list current month (for example, "Nov").
Afterwards, "Monthly Change in Total Assets" needs to be calculated automatically. For instance, "Total Assets in November - Total Assets in October".
I assume that, I need to use conditional calculation functions. But it did not work the way I expected.
Can you please help, me. Thank you in advance for your kind assistance.
Sincerely,
Considering the layout of the data is similar to as shown in the image, try this...
In B5
=IF(COUNT(B2:G2)=0,"",IF(COUNT(B2:G2)=1,B2,INDEX(B2:G2,MATCH(B4,B1:G1,0))-INDEX(B2:G2,MATCH(B4,B1:G1,0)-1)))

Pivot table not comparing January current year to December of previous year/Excel 2013

I created a pivot table from data that spans from 1/1/2013 to 8/31/2014. I have a column to compare the difference from previous month, but it will not return a value for January 2014 compared to December 2013. I have searched for the answer but was unable to find anything that actually resolved the issue. Any help is greatly appreciated.
The data feeding the pivot table is structured something like this.
UNIQUE_IDENTIFIER DATE MONTH YEAR REVENUE
The structure of the pivot table is YEAR and MONTH in the "ROWS" section. Revenue is summed up in the value section. Next, I have the sum of revenue calculated as a percentage difference from previous month. Then I have sum of revenue calculated as a percentage difference from previous year.
I know this question was asked almost three (3) years ago but I have came across the same issue recently.
How I solved the problem:
Added another Column called MonthID. This basically giving months from previous years an accending number
2016 Jan to Dec = MonthID: 1-12
2017 Jan to December = MonthID: 13-24
Used MonthID in the Rows Section
Set Value to % Difference From using MonthID

Top X in Excel/PowerPivot Pivot Table Filtered by Column Label

I'm working on a Powerpivot Pivot Table listing sales for my company. The table looks like this:
Row Label: Client Name
Column Label: Year
Values: Sales Amount
So something like this (columns are Client Name, 2014, 2013, 2012)
Client 1 | $10,000 | $15,000 | $20,000
Client 2 | $15,000 | $12,000 | $30,000
I'd like the table and the years to be the same but I want to show the top 25 customers only for year 2014. If I tell it to take top 25 by customer sales it gives me top 25 by total sales given all the filters. How can I do this?
Master_cylinder,
after thinking about this I suggest creating separates calculated measures (Excel 2010, in 2013 it's Calculated Fields) for each year that will allow easy filtering. It might be tricky if you have way to many years, but this way you can be sure the results are filtered exactly how you need to:
So for each year, create this simple measure:
=CALCULATE([Sum of Sales], Sales[Year]=2014)
For other years, simple change the filter parameter at the end - replace 2014 with different years. Than drag all the measures on the table, so that you will get something like this:
When you are done, simple filter the table using regular filter option and pick those settings:
This will get you the results you need.
PS: This is the powerpivot table structure that I was working with, and link to my source file in Excel (2010):

Resources