I am often building pivot table reports for users for products or customers. Users often request that additional information be displayed within the pivot table for those row items. For example, in a pivot table showing item sales by year, they want me to include a column that shows what TYPE of item it is or who the author is. These attributes are additional properties of the item, and they are 1:1 for each item. I don't want them to be grouped. How can I do this?
For example This is a pivot of books by year. How do I add the author attribute without grouping it?
Title | Author | 2019 | 2020 | 2021 | Totals
Awesome Book | J. T. Joel | 100 | 120 | 90 | 320
Crappy Book | Karl Klapp | 50 | 40 | 10 | 100
I'm used to doing this pretty easily in SQL, so I'm confused as to why it is hard in this context? Probably I have some fundamental misunderstanding about how pivots work, but maybe I'm just missing something obvious?
Thanks.
Related
When using the summary function "Group" in Saved Searches (SS), is it possible to show the total count inline or even use it inline? For example, I have a SS that counts the number of cases closed in a certain date range and it groups by the assigned employee and the total is listed at the bottom, as per usual. However, when trying to calculate the percent of the total each employee closed, they all show as 100%.
Here is a picture of the results and I have also added the formulas I am currently using. Here is what it looks like when I'm editing the search. The right most columns were my attempt at getting the total inline.
I'm fairly certain this is because I am grouping by the employees (or else there would be almost 3k lines in the report), but I don't think there is a better way to solve that problem other than by grouping by the employee.
We have tried doing an actual report in NetSuite (as opposed to saved search), however, the report times out quickly and we are hoping for a quicker solution. We also considered a KPI scorecard, but the issue would be that we would need to make a SS for each employee which isn't a good long-term solution due to team changes.
Is there a way of calculating the percent of the total when using grouping? Sorry for the long post, I was trying to be as descriptive as possible. The goal is to see how much (percent wise) each employee contributed to the total cases closed.
Take your SUM column that counts the closed cases.
duplicate it but add the function % of total
So
| Field | Summary Type | Function | Formula |
| ----- | ------------ | -------- | ---------------------------------------------------- |
|Formula Numeric | Sum | | Case When {status} like 'Closed%' then 1 else 0 End |
|Formula Numeric | Sum | % of Total | Case When {status} like 'Closed%' then 1 else 0 End |
Background
I am building a simple dashboard in the Power BI plugins for Excel (Power Query, Power Pivot & Power View) to get some experience with Power BI. The dashboard is for presenting simple time reports made by a consultant (i.e. myself). The format i want to use for inputting data is in a Excel table as follows:
InputData:
Date | Timecode | Duration[hrs] | Tags
-----------|-----------|---------------|----------------------
2016-02-01 | CustomerA | 1.2 | Support;ProductA
2016-02-01 | CustomerB | 0.3 | Support;ProductB
2016-02-02 | Internal | 4.2 | Development;ProductA
The Date field is simple. The date that the time report is for. The Timecode is the "name" of the hours reported. In common software this is usually a Project code or similar, but i want to keep it on a customer basis. The Duration is a float representing the number of hours spent for that Timecode that day. The Tags column is the interesting part: to simplify input is want it to be a (semicolon) delimited string, but that wont do when creating a data model for Power view.
What I am trying to make is a separate table with the all the tags, and a link table to connect the tags to the corresponding rows from the time report. In the Power view report, I want to be able to filter my time reports on the tags, such as analyzing the time spent on ProductA or Support.
Question
How do you take a non-normalized field such as Tags above and replace it with a dimension table and a link-table, using Power BI plugins for Excel? How do I end up with the following Three tables:
TimeReport:
Date | Timecode | Duration[hrs] | TimeReportID
-----------|-----------|---------------|----------------------
2016-02-01 | CustomerA | 1.2 | 1
2016-02-01 | CustomerB | 0.3 | 2
2016-02-02 | Internal | 4.2 | 3
LinkTable:
TimeReportID | TagID
-------------|--------
1 | 1
1 | 2
2 | 1
2 | 3
3 | 4
3 | 2
TagsTable:
TagID | TagName
-------|----------
1 | Support
2 | ProductA
3 | ProductB
4 | Development
Attempt
By picking out only the Tags-column and then splitting, pivoting and removing duplicates (inspired by this link i have managed to create the list of all tags as in:
Tags:
TagName
----------
Support
ProductA
ProductB
Development
But I cant manage to understand how to link the tables to eachother. Please aid me in this.
I think you have 2 options:
using Power Query, add Merge & Expand Column steps to join TimeReport to LinkTable and then TagsTable
using Power Pivot, load all 3 tables then go to the Diagram view and establish relationships between them. Use "Hide from Client Tools" to hide the columns that are meaningless to the User e.g. TagID
I prefer Power Query as the functionality is more flexible and it is much easier to debug.
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])
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.
I'm having an issue with Excel to which I can't find an accurate solution online.
I have this table:
PERSON | DATE | SIZE
==========================
Matt | 1-10 | 90.1
Jane | 1-10 | 71.3
Matt | 1-11 | 90.0
Jane | 1-11 | 71.0
Matt | 1-12 | 89.6
Jane | 1-13 | 70.2
And so on...
The thing is that this is the best solution for inputting this kind of data. I can't have two different tables, one for each person involved, because more people will probably be involved later on, and they all should be included in the same table.
As you can see, the idea is to monitor their weights. And this would be better achieved visually by a line graph that can tell each person what their progress is.
To this end, I would like to set up one graph that shows each person's progress individually as a different line. Like this:
I was wondering if there was any way of having Excel automatically build this line graph using this table but ordering values according to if cell X has value....
Not being able to find that, I also tried to set up an invisible table that would gather each set in its own column. For that, I was thinking of using an IF statement but I can't seem to find a way of getting that to populate a separate table, row by row, with the data from the original table. On the Internet I can only find how to add up all the values in a certain cell if another certain cell has X value.
I was wondering if anyone out there could give me a hand with this. Thanks in advance!
I would use a pivot table and pivot chart to accomplish this.
Insert a pivot table, select your entire data range (including headers).
Select Person, Date, and Size in the field list.
Under pivot table options select pivot chart and choose your desired chart type.
Move Person to Legend Fields, Date to Axis Fields, and Size to Values.
Right click the pivot table and go to PivotTable Options
Under "For empty cells show: " write N/A (this will let Excel ignore missing dates)
Here is an example of the blank values.
Let me know if any further clarification is needed.