Dynamic axis labels with power Pivot - excel

I am working with Excel and Powerpivot. In my data layer I have two tables related, in the main table I have my data and the ID that refers to my second table which is a reference table containing (Description, short description, units, abbreviation,..)
Simplified example:
Table 1:
Name Year Value Indicator
Usain Bolt 2009 9.58 1
Mike Powell 1990 8.95 2
Table 2:
ID Discipline Short_Descr Unit
1 100 metres 100m seconds
2 Long Jump L. j. metres
I want to create a chart where the axis and title are dynamic using the values in the reference table. The dynamic title is quite easy to build: I create my pivot chart using as Report filter the Description, and then I reference the chat title to this filter. But I would like to include in the vartical axis dinamically the units. So if I change the filter the units in the axis also change

Related

Excel chart Categories against variable quantity of Price Points

I have some data which I would like to plot, presumably in a scatter chart. The data is in the following format.
Category, ID
Cat1, 560000
Cat1, 560005
Cat1, 880011
Cat2, 580000
Cat2, 580001
Cat2, 580002
Cat2, 780052
Cat3, 600000
Cat3, 600010
Cat3, 600011
Cat3, 1003452
For non-developers, you could think of this as Categories of Tyres and their Prices. I'd like to see that in the "Car" category, we sell items in a set of different price points and in the "Bicycle" category we sell items at a different set of price points. This metaphor only breaks down in that no 2 products can use the same price.
For developers out there, these are in fact a Long, Primary-Key to a particular relational database table and I'm attempting to plot how much and what parts of the available ID range have been utilised already, based on splitting the data into some categories.
I have 13 categories, so these will have to become the x axis due to excel limiting that to 255. Therefore ID will be my Y axis.
By using a 2D Line Chart on just the IDs, and squashing the chart, I was able to plot the overall usage of the ID range.
However, I'm unable to get any chart type to split this by category - I presume XY Scatter or Heatmap has this ability somehow.
Update:- Since posting I have encountered this "Contiguity Chart" which is roughly what I'm after but in Excel if feasible
https://qvdesign.wordpress.com/2012/03/29/qlikview-contiguity-chart-aka-that-chart-from-the-windows-disk-defragmenter/

Multiple Calculated Columns with Filters within Single Pivot Table

I am working to create a Pivot Table in Excel that has multiple calculated fields that take into account whether a condition is true, but cannot figure out how to create this within a single Pivot Table.
Behind the scenes, I have a set of data with a column that can have these values: A,B,C,D,F,L, or R.
I have another column that is a dollar value, and another for Quantity.
I am trying to calculate the price per unit when the Category is A,B, or C, but also calculate the price per unit when the Category is D.
I can create multiple Pivot Tables and tie them to the same slicer, but the issue is this: I need to display the spending in each of the two categories for each location, and when I create two separate Pivot Tables for this, locations that do not have spending in one of the categories are excluded (in this below case, location 2 has no spending in Category D, so it does not show up in the second Pivot Table).
Here is a portion of my data set. The whole data set is over 100,000 rows and will change over time, so I do need a solution for the long-term.
Location Category Volume Quantity
1 A $120.32 6000
3 A $30.08 1300
3 A $60.16 2600
1 B $39.91 1000
2 B $318.50 13000
2 C $196.00 8000
1 D $220.50 8100
3 D $171.50 6300
3 D $35.90 1000
3 D $53.85 1500
2 F $416.50 0
1 L $24.50 0
2 L $30.08 0
1 R $55.13 0
2 R $55.13 0
3 R $110.26 0
Thanks in advance for your help and let me know if I need to clarify anything!
Alright, a little more digging yielded the answer.
A slicer should be included that has all locations selected, then it should be tied to all Pivot Tables in use.
For all Pivot Tables, go to Field Settings, then click on the Layout and Print Tab. Check the box 'Show items with no data'.
Then go to Pivot Table Options and select the values you would like to display for blanks and errors.
I found the solution here.

How to Combine Columns with the Same Heading in Excel

I have a set of cost data for different pieces of unique equipment. Each piece of equipment is classified as a particular equipment class which I have pulled from an index match on the unique equipment number. I now have a set of ~9000 columns of cost data, each with a column header of one of the ~300 equipment classes.
What I want to do is to get the median, 25%, and 75% for the full data set for each of these equipment classes.
I either want to create a single long column of all the data for each equipment class, or have a way to calculate the Percentile() values for the data in all columns with the same heading.
I could filter the data for each equipment class one at a time and calculate the percentile values, but with 300 equipment classes it would take forever.
Example:
Class01 Class02 Class01 Class03 Class03
1 4 7 10 13
2 5 8 11 14
3 6 9 12 15
And I want the 25%, median and 75% for the distribution for Class01, Class02, and Class03
Thank you for your time.
I either want to create a single long column of all the data for each equipment class, or have a way to calculate the Percentile() values for the data in all columns with the same heading.
I'll just tell you how to change your data around. From there the percentiles/ quartiles will be straight forward.
Start with your data like this. Notice that I added a column on the left. It's easy to make, just type Item1 and drag down (or double click the small square in the bottom right corner of the cell)
You then need to hit Alt+D+P.
Select multiple consolidated ranges > next
Next (create page ranges for me...)
Select all of your data as the range, click add then finish
You will now get a pivot table that looks like this:
Click the grand-grand total (i.e. 120) and that will create another pivot table like this:
Et voila...

how to show 0 data point in visualization when data is missing in data table?

i have one visualization,
on x-axis i have months of date column,
on Y-axis i have unique count of issues.
i have 2 filters in text area,
when i am selecting some values in filter 1 or filter 2 than if count is not available for any month than i need 0 for that month.
Lets suppose i have 5 month(Jan to may) data in my data table, i selected 1 value from filter 1 and 1 value from filter 2, if that combination data is not available for march and April, than trend should show 0 count for march and April.
it is a trend line so if count is not available for any month for selected filters than it should show 0. any lead will help.
TIA
Go to the x-axis settings of your vizualization, click on settings next to your month variable and with the categorical options, choose show all values. If you have a bar chart it will show you the 0 values. In a line chart Spotfire will continue the line as if there are no missing values. In this case you need to add markers to your line.
1:

How to plot multiple grouped data in one excel scatter plot with lines

I am facing some difficulties with plotting grouped data (by index) in one graph (scatter plot with lines) in Excel, and I will appreciate a lot your help.
My data are in three columns:
The first column is the index of the data or the group (i.e. a unique number for every set of data)
the second column is the time
and the third column is the data
Group, Time, Data
1 1 12
1 3 12
1 4 28
1 8 56
1 12 37
1 24 40
1 48 34
2 0 7
2 1 14
2 4 6
2 8 63
2 12 4
2 24 35
2 48 3
und so on.
and I want to plot the data vs. time for each index i.e. data group alone, but on the same graph.
Until now, I was always doing it manually by adding each data set separately to the graph. But I think there should be a more clever and easier way to do it, especially that sometimes I have a lot of data (index number can reach 70 or 80).
Thanks a lot in advance.
You can create a pivot table on all your data. Use 'Group' as column headers and 'Time' as row headers. The resulting pivot table will have all time points from all groups as rows and your groups as columns. Each columns of course has entries only at these time points which are included in its group. The other cells are empty. If you just select the data range of this pivot table without column headers, you can get charts from the data as a plot chart omits empty cells.
Update
That is the result pivot table of your test data. The sorted data are in the red frame. (Forget the total results)
A way to do this in Excel 365 is:
Select the data
Go to Data -> From Table/Range to open the Power Query editor
Select the columns with grouped data
Select Transform -> Pivot Column
Select the column with the values corresponding to the grouped data
Under Advanced Options change the value aggregation to Don't aggregate
Click OK, then Home -> Close and Load
This should give you the data formatted in such a way that you can select it and create a chart as normal.

Resources