Use datamodel data for cell formula - excel

I have an excel file that has a table imported from a txt in a sheet (using New Query). From that table I created a pivot table and some formulas like for example MAX().
I was told that for large files it is better to add the info to the data model as connection only (the data is not visible in a sheet).
No problem in creating the pivot and works great, but trying to do the formulas excel does not find the Table.
Before I could do something like this:
=+MAX(Table1[#[Column1]])
but know when I do MAX, the system does not find the Table1 I have loaded as connection only. Is there any way to relate a formula to data that has been added to the model as connection only?
Thanks.

In order to access data in the data model you can use "Cube functions" you can follow these steps:
1- From inside the "Manage Data Model" option, create a pivot table of your table
2- Customize the new pivot table according to your needs
3- Click the ribbon "PivotTable Tools" | "Analyze" | "OLAP Tools" | "Covert to formulas"
4- Optional: Merge the formulas in one
Remarks:
The functions (MAX, SUM, Etc.) must be defined in the Pivot Table.
Here is an screencast I created for you.
Reference: https://support.office.com/en-us/article/cube-functions-reference-2378132b-d3f2-4af1-896d-48a9ee840eb2

First Create a Data Model table then use
=MAXIF(Table1[Values],Table1[Labels],"a")

Related

Show raw data from table in PowerBI

is it possible to view raw data data build table? For example example if I clicked one of this number is it possible to see all raw rows that was summarize in columns customer, finance, etc. I am looking for some view that is using in pivot tables in excel/google sheets. There are option that if you clicked in one cell there will be created new tab with filtered source data.
You can use the drillthrough feature to accomplish this. Basically, create a second page and create a table with all the data you want to see.
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-drillthrough

How to combine two worksheets (with different data between them) into one Pivot table?

I have one sheet that I manually enter quality scores on that looks like this
|Agent Name|Month|Quarter|Year|Quality Form|Score|
and another sheet that has production data (call times and goals)
|Agent Name|Month|Quarter|Year|Talk Time|# Calls|Call Goal|
I am trying to make a Pivot table (with slicers) that provides data that looks like this (the slicers would be for the month, quarter, year, or employee name)
|Agent Name|Score|Call Goal|
Tried messing with slicers. Tried consolidating tables. Tried using the data model. Tried using relationships (it kept telling me it needed unique values)
You could use the Power Pivot add-in to load both your tables into the Data Model (Excel -> tab "Power Pivot" -> button "Add to Data Model"), define the relationship between them (Power Pivot for Excel -> tab "Design" -> button "Create Relationship") and after that create your desired PivotTable in a new sheet (Power Pivot for Excel -> tab "Home" -> button "PivotTable").
Don't see a tab "Power Pivot"? Enable the add-in:
From the File menu, select Options, and then Add-Ins.
In the "Manage" box, select COM Add-ins, and then click Go....
Check the box next to Microsoft Office PowerPivot for Excel 2013, and then click OK.
As you mentioned already, you do need at least one of the tables to contain merely unique keys. Don't have it? Create one by combining multiple columns as a new column. Assuming each agent only occurs as a record in your tables once per month/year, you could use Power Pivot to concatenate a unique key into a new column with a formula like:
=Table1[Agent Name]&Table1[Month]&Table1[Year]
Do the same in Table 2:
=Table2[Agent Name]&Table2[Month]&Table2[Year]
Now, you can create a relationship between those 2 newly created columns and pivot as much as you want in Excel. Let us know how it works out!

Dataprep pivot transform

I'm new to Dataprep and now trying to create a pivot table using the "Pivot Transform"
https://cloud.google.com/dataprep/docs/html/Pivot-Transform_57344645#example---basic-pivot
I searched the documents and the syntax looks simple enough, except for the fact that it is out of context and not sure where to use it.
syntax is :
pivot col: (the parameter to be used as col) value: (value to present) group: (what to group by)
Other solutions that I found here and elsewhere all require lots of code and heavily rely on knowing the columns in advance
e.g : using case when ____ = 'name of col' to pivot the data
any idea will be appreciated
I'll assume that you have already imported the dataset with the data and then you created a new flow. When you add the dataset to the flow you can then add a recipe. You can find details on how to do so in the quickstart.
Regarding, the pivot transform, once you have added the recipe click on the Recipe button on top and then select Add New Step as depicted here:
Then, in the Transformation text box you can start typing pivot and select the Pivot transform as seen below. A menu will appear and you can apply the parameters using the UI.
Otherwise, you can just copy and paste the formula in the text box. For example:
pivot col:Date value:SUM(Sales) group:State
And the fields will be filled in and you can check the preview of the pivot transform:

How do you copy the powerpivot data into the excel workbook as a table?

I have data in powerpivot that I've modified and I'd like to place it into the workbook as a regular table (and not as a pivottable). I need this so that I can run use the table for some vlookups from another worksheet in the same workbook.
I found this answer: link which I will try and summarize with out cutting and pasting to much. This assumes you have powerpivot installed.
goto powerpivot and "import from and external source" the data you want to munge and bring back into the workbook as a table
Key here is to select the checkbox “Enable selection of multiple tables”.
when prompted at the "import data" window, pick pivot report (you won't really use this)
go back to powerpivot with the "Manage Data Model:
add a new measure below your data. something like: NRofOrders:=COUNTROWS(values(FactResellerSales[SalesOrderNumber]))+0
(you won't really use this but this seems to change the query to this table so that you can use DAX)
also add any columns that you want ( for me, this is want I wanted that I wanted to be reflected back in the workbook)
back to Excel, select the data tab, click on Existing connections and select Tables: and then pick a table from your query.
boom, you're done
(the link continues on and you should read that as it's interesting but at this point you should have powerpivot query with your modification as a table in your workbook)
The July 2014 update to Power Query (pushed out at the end of Aug) simplifies the answer. With the new Power Query Update you can pull the data into the Data Model with out having to also copy it to the Works sheet.
goto powerquery and import the data you want to munge. Use the option to just add it to the Data Model.
go back to excel and then go to powerpivot with the "Manage Data Model" button.
munge your data (add columns, whatever)
back to Excel, select the data tab, click on Existing connections and select Tables: and then pick a table from your query.
boom, you're done
In the PowerPivot window you can select the table, or elements of it, and then copy (nornal right click or ctrl +c) and paste that into your spreadsheet.
This works for reasonable amounts of data but if you try and do it with thousands of rows you may find that excel objects and falls over, based on my experience.
Vlookups kind of defeat the purpose of PowerPivot :-)
Found a great solution over on Mr Excel
(http://www.mrexcel.com/forum/power-bi/637919-extracting-static-data-powerpivot-without-pivot-tables.html)
If you are trying to get a PowerPivot table into Excel, then you can simply query it. The easiest way to set that up is to first create any pivot table based on you PowerPivot data. Then double-click the measures area to drill-through. This creates a table with a connection to your PowerPivot model. Then edit the command text by going to: Data > Connections > Properties > Definition tab > Command Text.
Change it to something like
Code:
EVALUATE Table1

How to select entire excel spreadsheet for pivot table?

I want to be able to select and reference all of the tabs in my excel spreadsheet (to get totals of everything), but the data source only allows one tab to be selected... is there a way to select and use the entire workbook in the pivot table?
Thank you!
You actually just have a data formatting problem. You're using tabs to separate devices by departments instead of simply creating a department field/column and putting everything in one tab. The data was likely delivered to you that way, but don't let the delivery format define the true working format of the data.
Combine everything in one tab, and then you'll be able to use the data in a pivot table just fine.
If you have more data than will fit in a tab, put it in a database such as MS Access, MS SQLServer or mySQL, and then tell excel to use the database as the pivot table source.
I think Jonathan M has the best answer, but here's a way to do it using SQL that I've used successfully.
I don't know any easy way of doing this, but you could write a macro to copy and paste all your existing sheets onto a single new sheet (assuming there's enough room on a single sheet).
In 2007 Multiple Consolidated Ranges isn't in the default pivot table window. You need to create your pivot table, click on it, hit Alt + D, then P. Click back to step one and you'll have the option for multiple consolidated ranges.
Select the data on any of the one sheet and hit Alt D > P. It will show you Step 1 of 3 for PivotTable Wizard. Now select Multiple Consolidation Ranges and hit Next.
Select and add different fields from different tabs and it will create a consolidated range for your PivotTable and then you can run your PivotTable based on data located on different tabs of sheet at the same time.
Hope it helps.

Resources