I'm trying to add a column to a power pivot table where it shows the trendline of only the last 3 dates. It's currently being done manually every week in a normal table, using the trend formula, where a chart reads the data. I've changed the data to be pulled into a power pivot table so that it can update automatically every week.
I know you can add a trendline to a graph automatically, but then it is calculated for all data points, not just the last 3.
I've seen code and examples online to add trendlines with INTERCEPT and SLOPE but again that is for all data points.
The graph shows 12 weeks, but only the last 3 should have a trendline that is based only on those 3 points.
example:
I've got a column in the data model that identifies which lines of data falls within the last 3 weeks via TRUE or FALSE. The data in the data model is all files combined and identified by their weekending date, and the %'s are from calculations.
TIA
Related
About the chart
I have a pivot chart based on a table with historical data and seek to report only the past 12 months of data. Furthermore, the chart is connected to a slicer with a twelve month period selected. For each series of data (Green, Blue, Grey) i have added a three period moving average trend line.
My problem
As shown below, the moving average trend lines start from the third month onward, naturally as there are insufficient data within the chart to calculate a trend before month three.
My question
Is it possible to include data prior to the first charted period from the source table (which is available) to calculate the 3-period moving average in a pivot table?
To clarify, i want to keep twelve periods in the bar chart, but
include fourteen periods for the moving average calculation to achieve full
twelve-period trend lines
I have a graph with data for each day. I would like to only show the average of the data per week on my graph.
Here you can see a part of the chart. What I want is that these 21 (42) bars (days) shown in 3 (6) bars (weeks).
Can Excel do this without me having to manipulate the data and creating averages per week?
If Excel can't, what would be the most efficient way to create this dataset, if you know my data is organized following this structure (going until 31/12/2017).
I appreciate you reading my question and I hope you can help me out.
Plot a PivotChart with Average of for VALUES and ROWS (dates) grouped by Days and 7.
Let me first say I am very new to Cognos and have mainly learned by just manipulating items within active reports. I am having an issue with creating a graph that acts like a time series. I want it to display every month (with multiple values in some months and none in others). I want to visually see gaps between data points (ex: we order products every 3 months starting in January, so we should see gaps in the months we do not order products - like February and March).
I have tried changing the label control to manual and setting display frequency to 1. However, I think my issue is that there is not any data within certain months.
You are correct in that your problem is lack of data. A standard inner join will drop rows where there is not a corresponding row in both tables, resulting in gaps.
There are two solutions available:
Use a union to create "dummy" records for each date
Manually specify an outer join between the date table and the table containing the rest of information
Since the first technique is the most common, I'll outline the basic steps for it here.
Create a new query
Add your month data item to the query
Create a 'dummy' data item for your measure. Use 0 for its expression.
If there is a date range filter in the main query apply it here
Create a union
Drag over your new query into the union
Drag over your original query into the union
Pull in the date and measure data items into the union query
Set the Aggregate Function property of the measure to Total
Use the union query as the source for your chart
For every month with measure data you will have two rows, one with the measure amount and one with 0. The two rows will be combined by the auto-group and summarize function. The measures will be added together. Anything added to 0 will end up as the original amount.
For months with no measure data, there will only be the 'dummy' row with 0 for the measure and it will be represented in your chart.
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.
I am trying to compare Year over Year revenue for October on a line graph and I have decided my best approach is to create a pivot table with my month column grouped by a month and year format. My value is the sum of revenue. I then clicked on the pivot table and created a line graph that creates a total for all of my data I then filtered my row label "months" for only october and modify my graph data to create two series (2013 & 2014) and modify the Y value to be the revenue value, name to be the year and x axis label to be October, but no data appears on the graph. Why is this happening and what is the best fix?
You are trying to graph a line for 2013 with one data point, and another line for 2014 with another single data point. Excel cannot draw a line for one point (neither can I!)
The Y values for each data series need to be a range rather than a single cell if you want to see a line.
If you wish to see the single data point, use the data series format options to enable markers.