Pie chart in SSRS - visual-studio-2012

I have a report with 2 pie charts, giving sales data for product groups. Running a dataset from an OLAP cube.
I want to be able to select 2 different dates for each chart.
Example; Someone wants to compare November sales to the previous month. So one chart to display October, one to display November. Or they might want to see how Jan/Feb/Mar compare to Apr/May/Jun.
Can this be done from the same dataset, or do I need to point each chart to a separate dataset?

If the dataset returns the data for both months, you could add filters to each chart to show the appropriate one. However, it sounds like you'd want this to be more dynamic.
I would suggest creating two separate datasets, each with a month parameter. This will allow the user to select any combination of two months. The charts would simply point to their respective dataset. You shouldn't incur a noticeable performance hit either way.

Related

Pivot Chart - 3 date columns, how to show counts of the dates by month?

My goal is to have a count of three different dates by month in a bar chart. Currently we are using a count if formula then building the chart above that, would like a cleaner solution. I have three columns, Open, Action, and closed dates. Adding all three to the axis doesn't produce the right results. I'm stuck. Is there something in the pivot that I can change? I'm pulling the data in via Power Query, is there something there I can change? Many thanks :-)
Ideal state
Recent Action and Closed dates are not show up, that seems to be the real issue. Why and how to fix it?
Sample of data
Created a date table in Power Query.
Also in Power query, duped my data then deleted all but the columns I didn't need.
Unpivoted the three date columns.
Joined the new date to the date table.
Graphs fine.

Excel Pivot Table difference in columns of "shown as" values

Is there a way to let a pivot table calculate the difference between 2 columns automatically when the values are shown as a % of the parent column total?
Now I need to to manually but the table is dynamic and number of competitors may vary. Function seems so easy but can't find it after googling etc...
See example picture below of what I want to achieve.
(Column F automated by the pivot table is the goal)
If trying to solve this with PivotTables, you've got a couple of options:
Use a 'Traditional' PivotTable that's based on a range. This will give you percentage differences, but you can't get percentage point differences like you're asking for without using external formulas.
Use a 'OLAP' PivotTable that's based on data you've added to the Excel Data Model. This will give you both percentage differences and percentage point differences, without having to resort to using external formulas.
In both cases, I recommend that you unpivot your data first, so that it is in what's known as a Flat File. Currently you're using a cross-tabulated data source (i.e. your source has columns called Year 1, Year 2), and the type of percentage comparisons across years you want to do doesn't work if your data is a crosstab. Basically, PivotTables aren't meant to consume cross-tabulated data.
Instead, you really want your data laid out so that you have a column called Amount and a column called Year, and then you can use the Show Values As options available from the right-click menu to show as percentage differences across years. To transform your data into a flat file, see my answers at convert cross table to list to make pivot table
That said, you can still use the GETPIVOTDATA function on your existing (unpivoted) data layout in a way that is somewhat more robust to changes in your PivotTable structure than just subtracting one reference from the other:
But again, I recommend transforming your data into a Flat File. Then you can additionally do the following:
Using a 'Traditional' PivotTable:
You can kinda solve your problem entirely within a self contained 'Traditional' PivotTable if you drag the Amount column to the Values area, put the Year column in the Columns area, put your Competitors in the Rows area, and choose one of the percentage Show Values As options you'll see when you right-click a cell in the Values area.
I say kinda, because without using external formulas (or without calculating the percentages back in your source data), you can only get it to show percent increases (see far right column), not percentage point increase like you want (see far left column). That said, I think percent increase is less confusing. But I guess it depends on what you want to show. If you want to show say change in market share from one year to the next, then percentage points make sense.
Of course, you could always use the GETPIVOTDATA function to do the additional math for you like we did earlier, like I've done on that left hand side.
Using an OLAP PivotTable based on the DataModel
Calculating percentage point increases likely requires using PivotTables built using the Data Model. See my answer at https://stackoverflow.com/a/49973465/2507160 that explains a little about the Data Model (although it doesn't answer this specific question).
Here's the result:
Here's the measures I used to do this:
Total Year 1:
=CALCULATE(SUM(Table2[Value]),ALLSELECTED(Table2[Competitor]),Table2[Year] = "Year 1")
Total Year 2:
=CALCULATE(SUM(Table2[Value]),ALLSELECTED(Table2[Competitor]),Table2[Year] = "Year 2")
% Year 1:
=CALCULATE(SUM(Table2[Value]),Table2[Year] = "Year 1")/[Total Year 1]
% Year 2:
=CALCULATE(SUM(Table2[Value]),Table2[Year] = "Year 2")/[Total Year 2]
p.p. Diff:
= [% Year 2] -[% Year 1]
You can add Calculated Fields to Pivot Tables, of varying levels of complexity. Finding the difference between two fields is about as simple as it gets.
The example below is borrowed from contextures.com, where there are many more examples more further information.
To add a calculated field:
Select a cell in the pivot table, and on the Excel Ribbon, under the PivotTable Tools tab, click the Options tab (Analyze tab in
Excel 2013).
In the Calculations group, click Fields, Items, & Sets, and then click Calculated Field.
Type a name for the calculated field, for example, RepBonus.
In the Formula box, type =Total * 3%
Click Add to save the calculated field, and click Close.
The RepBonus field appears in the Values area of the pivot table, and in the field list in the PivotTable Field List.
(Source)
EDIT:
#jeffreyweir - I'm not gonna lie, I don't know off the top of my head how to make this work (and don't have time to experiment) but by the looks of these options, isn't a calculated field with a "straight subtraction" of existing fields (ie., 3$-2%=1%) very possible with Difference from? (as opposed to % Difference from which is also an option but for a different result).
In fact, automatic year-over-year difference reporting should be readily possible with the <previous> and <next> comparison operators...?
                                 (Click to Embiggen)
     
Also, did you see the link where I got the example? Kind of a hoakey site but it has some more complex pivot table instructions.

Creating bar graph of event occurrences for each month of several years in excel

I have a long list of dates (about 2000) in an excel spreadsheet and I want to see how many of these dates lie within particular years (and roughly which part of the year also if possible). I know how to make basic graphs in excel, but I'm not sure how to make a bar graph that uses dates. Any suggestions?
I can obviously split events in day, month, and year and then use count to count the amount of each year, but this would not show the placement of the event within the year in the final graph.
20/03/2000
2/04/2000
3/04/2000
26/05/2000
7/06/2000
20/06/2000
22/06/2000
10/07/2000
12/07/2000
22/07/2000
2/08/2000
8/08/2000
11/08/2000
14/08/2000
15/08/2000
12/09/2000
15/09/2000
20/09/2000
25/09/2000
2/10/2000
22/10/2000
24/10/2000
25/10/2000
27/10/2000
1/11/2000
10/11/2000
13/11/2000
16/11/2000
18/11/2000
20/11/2000
25/11/2000
27/11/2000
3/12/2000
6/12/2000
20/12/2000
21/12/2000
22/12/2000
4/01/2001
7/01/2001
11/01/2001
24/01/2001
25/01/2001
2/02/2001
4/02/2001
9/02/2001
12/02/2001
13/02/2001
20/02/2001
21/02/2001
2/03/2001
11/04/2001
19/04/2001
20/04/2001
21/04/2001
24/04/2001
27/04/2001
28/04/2001
2/05/2001
3/05/2001
5/05/2001
12/05/2001
13/06/2001
20/06/2001
25/06/2001
3/07/2001
5/07/2001
18/07/2001
20/07/2001
21/07/2001
22/07/2001
25/07/2001
4/08/2001
5/08/2001
9/08/2001
10/08/2001
11/08/2001
12/08/2001
13/08/2001
31/08/2001
11/09/2001
12/09/2001
17/09/2001
3/10/2001
10/10/2001
18/10/2001
21/10/2001
23/10/2001
4/11/2001
5/11/2001
17/11/2001
22/11/2001
23/11/2001
27/11/2001
29/11/2001
3/12/2001
I cannot check this in earlier versions of Excel, but in Excel 2016, if you build a Pivot Table with your data and drop the date in the Rows - you get your data grouped in Years, Quarters, and Months. If you also drop the date into Values, then you get the Count of values in each year, quarter, and month.
Then a pivot chart looks like this ...
A less magical way to do it
Applies to Excel 2013 and up
From your single column of dates, build a pivot table.
Put the date in Rows. Put Count of date in Values.
Select any one of the dates. Right Click and choose "Group...", or choose "Group Selection" from the Analyze ribbon.
Click on each of Months, Quarters, and Years.
Filter how you would like.
Select PivotChart from the Analyze Ribbon.
You can create a scatter graph as suggested in the comment. Consider your data set and see if there is any other quality that could be added to the chart, which could be plotted on the value axis. For example the number of people attending the event, or the duration of the event in seconds, or something like that, so that the graph contains more information. In the following screenshot, the blue dots are just the 1's from column B plotted on the time line. The orange dots plot another data aspect on the vertical axis.
If you create a pivot table of the dates and drag the date into the Sums area you will get a count of each day, make sure this is sorted. Then a chart will show the number of records for each day. You will need to copy and past values from the pivot to a new sheet to be able to make a scatter diagram from the output of the pivot table (in Excel 2010). But once it is a scatter diagram the events will be in the "correct" places.
If you wanted to group it by month instead you could use a formula to create a column of year & month and then do the pivot and chart on that column. For example the formula below will give you 201605 for May 2016.
=YEAR(A2)&RIGHT(100+MONTH(A2),2)
Weeks would be a bit trickier, but I suppose you could divide the date by seven and then INT it to get a 7 day grouping. These wont show the actual events occurance within the period but would let you see which periods have the most events.If you are looking for things like more events at the beginning of the month or something you might need to try different "groupings" like weekly.

Group values into an "others bucket"

I have a list (30+) of users with the number of times those users were active per month in my system. I'm using an Excel chart to show which users have been consistently active over time. About one third of the users come consistently (several times a month) while others come one month and not another.
Unfortunately since I have 30+ users, the colors in the Excel chart are difficult to distinguish from one another. What I was thinking to remedy this was to only show the top 10 (or 15) users and group the others into an "others" or "catch-all" bucket and still shows it in the chart.
A sample image of the chart:
What's the best way to do this?
Add a column that differentiates 'Active' from 'Non-active'. In the sample I had to create overall B and C were the most active so I populated D2 down with:
=IF(OR(B2="B",B2="C"),"Active","Non-active")
Adjust the formula if that distinction is made on a month by month basis. Create a Stacked Column PivotChart and in the PivotTable move the 'Active' together as necessary. Select each of the Non-active series (here only two for illustration) in the chart and apply the same colour fill to all.

Can I display daily data in month buckets using only excel's chart formatting?

I have daily sales figures that I'd like to plot on a simple linegraph.
I would like them to be shown in monthly buckets (i.e. if I sold 5€ on Jan 01 and 10€ on Jan 24, I would like to see only one data point for January with 15€ in it).
Please note that I don't want to use any supporting formula/VBA script, I want to do this using only chart formatting.
I tried setting the chart's X-axis type to "date axis" and I chose "months" as the base unit.
This almost works, but the line graph ends up being kind of weird. Changing the chart type to histogram doesn't help much either. The individual sales are not "piled up" like I would but, instead, they're hidden one behind the other. Stacked histogram doesn't work either.
Any clue on how I can force excel to bucketize my data using only chart formatting? This can't be that hard...
Try creating a pivot chart, then grouping the dates by month (right-click a date in the pivot table, and click "Group by... Month".
If you want to group by Years as well - hold down the Ctrl Key whilst you select the Month (both categories will then show up)

Resources