PowerPivot and dax formulas - excel

new to this but i need some help with PowerPivot. I have recently created a PowerPivot to pull through 3 different excel documents that will be updated automatically each week with new data. They all have at least 2 of the same unique codes to be able to link them together.
I have managed to link all the files together and create a pivot to show the relevant information from each file under one pivot. my problem is now I need to add some formulas that relate to the actual data in the pivot.
Q1:I need the average of the last 4 weeks of data from the pivot but i need the formula to be able to shift when the new weeks are added.(if there is a way to do this with a dax formula that would be very good as well.
I have dates and weeks in the data set.
Basically I'm after knowing if I am able to create formula next to my pivot that will shift the the data grows or changes.
currently the pivot looks like the picture attached.
I have also attached a pic of the data
Q2:How do i get the pivot to only show me the last 4 weeks nothing else
if anyone has any suggestions on how I could get any of this to work that would be amazing.
Thank in advance power pivot datapivot table
Q1: what i have tried -I have tired to add formula next to the pivot but it breaks or gets deleted when the the pivot updates
Q2: I have created a slicer and I manually change it

Related

Get slicer selection of a data table

I have been struggling with this issue in the past days and haven't found yet any solution.
I have a simple table (not a pivot table) and some slicers attached to it. I want to 'simply' show selected value/values of the slicer in a cell. It implies of course to make the cell update automatically according to the selection.
Some of the solutions I found suggested using two pivot tables, one main for the regular data and the other hidden to capture the selected filters. The problem is that I am not working with a pivot table, but rather a simple table.
I also tried getting distinct values of the table column, but I couldn't perform it properly without getting the hidden values of the filtered table too.
Is there any way in Excel to do this simply?
Thank you!
You can follow the below steps to achieve your result
You will have to insert a serial number column in your table
After that insert the below formula above the header or anywhere you want to display the selected value
The formula in C2 is
=INDEX(Table1[Data 2],SUBTOTAL(5,Table1[S.No]))

Ignore tier 1 rows in Excel pivot tables

I have a pivot table in Excel, and I'm trying to do some calculations on the results. This is all fine and good, but I'm running into a problem due to the grouping of a pivot table.
I have a dataset indicating transaction history for a particular client/patient at a vet clinic. These are reflected by clientID and patient name in my pivot table. I've used a pivot table to group by client then patient to see when the first purchase was made and how many total purchases there have been. I want to then do a calculation on that for each patient.
My problem is here. Excel has all the data for each client grouped in what I'll call "tier 1 results". The only data I want to do the calculation on are the "tier 2 results". These are row 7 and then rows 8-9 in the screenshot below.
In effect, I wan to include something in the equation in column F to ignore any bold text, but Excel doesn't appear to be able to do this. VBA is an obvious solution for me, but I'm creating steps for salespeople to use to analyze the data while they're out in the field. We need to keep things as simple as possible. Copying and pasting an in-cell equation is one thing, but using VBA is way over their heads.
Any thoughts on how to ignore the tier 1 results?
Your pivot table uses compact form layout, where all the groupings appear in one column. You can change that to tabular form to have each group level in its own column. The screenshot shows the difference:
Click a cell in the pivot table and then Pivot table Design ribbon > Report Layout dropdown > Tabular form. There are other settings to get rid of subtotal rows, etc.
Now you can build formulas that take into account only the level that you require. (It is also possible to repeat the pivot group labels for each group level where there are blanks.)

inventory management with excel

My previous post seemed to have been unclear so I am posting this again and will try to explain the problem more clearly using screenshots.
https://www.dropbox.com/s/4x8wktbdo7jc21m/excel-screenshot.jpg?dl=0
Now, let me explain the screenshots.
Let's take just one of the raw materials in the table, say Rosin (Column B).
Whenever we buy more rosin, I mention the quanity bought and the date(Column A)
and I have the total quantity of rosin bought at the bottom using the formula "=sum(b80:b91)".
You will also notice that the number of rows at present is 11 i.e. 80 to 91.
But we will still be buying more rosin, even when I have entered the data in these rows. i.e. when I enter the dates and the quantity bought.
The problem is that I'll have to keep inserting more rows in there after every few days.
And if I keep doing that then the column for Rosin(as well as for the other raw materials) will become so long that I'll be scrolling forever.
So, is there a way that I could just enter the amount of rosin bought and the date without having to insert more rows.
Here's a link to the excel sheet that I created - https://www.dropbox.com/s/iod5y7jae6grmyz/brc%20goods%20received%20STOCK11.xlsx?dl=0
If you think MS Excel is not the right tool for this, then please recommend the correct tool for this.
I was learning some python and know some programming basics - just for your information.
P.S. Hope I have been able to explain the problem clearly this time.
I admit that the excel sheet looks very confusing and haphazardly done, but I wanted to start doing the calculations and improve the looks of the sheet later on.
basically, you need to use pivot tables to organize and sum your data.
here is an example sheet done for you to illustrate how it is done in your case.
therefore, you need to put each distinct data type in different sheets. In my example, I have put all of the incoming chemicals into one sheet and created a pivot table for it in another sheet. you need to repeat this for chemicals used in a separate sheet, and create a pivot table in the same/separaate sheet. And finally, in another sheet, you can make a table of total chemicals at present, simply by refering to the data in your pivots tables.
Every time you update your data sheets, come back to its pivot table and click refresh to get the latest and update your data across the table.
you can look up some help across tutorial sites on how to create a pivot table, here is one from microsoft
the best solution here would be not to keep multiple tables which you plan to extend on the same sheet, i looked at your file and it is way too confusing and clogged up, separate all the datasets you have into separate sheets, give good descriptive names to these sheets. I noticed you use total rows below each dataset, what you can do(as long as you are in Excel 2007+), create the dataset and then format it as a table from the menu, which makes your data a lot easier to read and handle, it also gives you the option of total row, more to read up on these tables you can here: Format an Excel table

Issues grouping in excel?

I'm having a little bit of trouble grouping dates in excel. I have created a pivot table that groups a bunch of dates between 3 months together. However, I want to take advantage of the refresh ability of pivot tables--the idea in which when you refresh your pivot table, it will update to whatever you added or took away from the source of data your pivot table is based on.
However, when I grouped the dates between three months together, I noticed if I don't add a date that exactly corresponds to the dates within the grouping, the picot table does not add that entry into the pivot table. For example, if my grouping had the following dates (between May and July) in it:
5/21/2013, 7/18/2013, 6/8/2013
And in my source data spreadsheet had the following date added to it:
5/2/2013
5/2/2013 would not be added to that specific grouping in the pivot table because it is not exactly like the other dates as stated above. I want it so that I can group all dates from 5/1/2013 to 7/31/2013 inclusively as opposed to the dates in the original grouping. Would anyone have an idea on how to do so? Thanks!
http://www.datawright.com.au/excel_resources/expanding_pivot_tables.htm
im curious as to how you are currently grouping them without adding new ones, there may be a way to work with what you already have especially if you are willing to incorporate some VBA
Provided your source 'dates' are not text Excel should be able to cope.
I fear (hope?) we were at cross-purposes about which "Group" to use. I meant the one that pops up (as on the left below) when right-clicking one of the Qtr headings in the PivotTable.
If you have access to add additional formulas in the data you could just calculate "quarter" in an additional column (reference here)
How can I obtain the year quarter from a date?
I tend to always make my groups in the rows of data like this, rather than attempt it using pivot groups. For example, you might also extract "year" with = year(A1) in the rows - so you can easily add it as a pivot row item later for grouping. If your data source is properly formatted as an excel 2007 "table" these kind of formulas will fill themselves downward when you paste new data.

Adding columns to a pivot table in excel

I apologize if my question is vague or was asked before. I have the below table in a spreadsheet
Region Next Service Date Duration Type Duration Frequency
New York 12/4/2013 Year 1
The spreadsheet has 4 columns and what I would like to do is to create a pivot table and somehow project the next 24 months service duration on the pivot table so the output would look like the below
Count of Unit Serial Number Column Labels Continue for
Mar-13 24 Months…
Region
New York Count of Services
Basically, I need to show the count of services for the next 24 months without editing the datasource tab of the pivot table.
As far as I know, you can't add columns to a pivot table.
If someone gives me an idea of how to add columns based on the duration and duration frequency to a pivot table, that would be a great start point.
Thank you all for your feedback and sorry for the misformatted tables
Use this formula
In cell A1 of Sheet2
=Sheet1!A1
Copy and paste as needed, you now have a duplicate of the data sheet, "without editing the datasource".
Create your formulas for projection info on Sheet2, and use Sheet2 as the source for the Pivot Table.
Be aware lots of formulas can bog down Excel, so if at all possible I would put your formulas for projection info on the datsource tab (Sheet1) and hide them. You will still be able to use them in the Pivot table when hidden.

Resources