Data in power query won't refresh with new data in my Power Pivot table - powerquery

My Power Query in excel won't update the data from my Power Pivot table in the same excel file
I have an excel file that use data from several sources.
One source is a Power Pivot table that i got from Exporting data from powerbi.com to analysis in excel.
I want to use the data from the power pivot table and transform the data in power query in my excel sheet. In power query, I have created a query from the sheet with the power pivot table.
The data in the Power Pivot table sheet is updated with new data when i refresh data, but the power query won't refresh with the new data from the power pivot table sheet. How can I get the power query data to refresh with the new data from the power pivot sheet..
Does anyone understand my question and know why?
Kind regards,
Cecilia

Related

Conditional formatting in QuickSight for rows in pivot table visualization

I am trying to add conditional formatting for a visualization in QuickSight. My requirement is to add conditional formatting for rows. Each row represents a metric value and each column represents a week. The pivot table option lets me make the visualization to see weekly trend of metrics. The issue is that there is no way to add conditional formatting for rows of pivots tables. If I create a regular table then I lose the two dimensionality of the table i.e. can't do metric vs weekly trend.
Is there a way to create conditional formatting for rows of a pivot table or is there a way to create a two dimensional table?

Create a summary table based on data from another table in Power Query

I am new and pretty inexperienced with Power Query, so have struggled with this issue and finding a basic tutorial on Power Query.
I am using Power Pivot to analyse some data. My source data is added to the Excel Data Model using Power Query from an external CSV file.
What I want to be able to do is create a summary table from the source data in a new table. This new table would be added to the data model. My source table (SrcTable) would look like this;
Order ID
Item Code
O-001
I-001
O-001
I-002
O-002
I-001
O-003
I-001
O-003
I-002
O-003
I-003
My new table would have two columns
A list of each Item Code
A Distinct Count of Order ID for each Item Code
So for the example above the SummaryTable would look like this
Item Code
Num Orders
I-001
3
I-002
2
I-003
1
Can someone please give me some guidance on how can I write a query to create this new table for me?
Thanks
Select your table using data...from table/range... to get it into powerquery
In powerquery
right click the Item Code column and choose Group by...
It should default to doing a count. You can change the name of the column from Count to Num Orders if you want. Then Hit Ok
The do File .. close and load to ... and decide how you want to get the data back into Excel. There is an optional [x] checkbox to add the data to data model

I would like to compare data between tables

I would like to compare data between two tables say source and destination and output the difference,
the problem is there's a mapping table which stores the columns of source table and corresponding columns of destination.
For example,
Table: T_MAP
SourceTableName SourceTableColumns DestinationTable DestinationTableColumn
s_t1 s_t1_col1 d_t1 d_t1_col1
s_t1 s_t1_col2 d_t d_t1_col2
s_t2 s_t2_col1 d_t2 d_t2_col1
....
So the question is how to compare the data between two tables with the map table.
Current idea is using dynamic cursor to generate dynamic sql statement, then using minus+union all to compare data. But the performance may be a big problem.
Is there any thoughts?
Please help..
Thanks in advance.

Tableau create a table matrix?

I have a CSV file that looks like this. It is in matrix form where cell A1 is empty. I want to visualize this in Tableau like this
a1,a2,a3
a1,1,0.2,0.3
a2,0.3,1,0.5
a3,0.6,0.7,1
How can I build this in tableau to show a matrix?
I tried putting measure name in both the row and column field and measure values in the marks text box but i ended up with diagonal values which isn't what i want.
First structure your data in the form of a table.
A well structured CSV file for Tableau (and most tools) has a single header row that labels each column (so skipping the first cell in the header row is a problem). Then each data row that follows contains only values in each field separated by columns (so there should be no leading row labels)
Order is not significant in a relational table. The rows in a table form a set, not a matrix.
So your CSV should look something closer to
field_name_1,field_name_2,field_name_3
1,0.2,0.3
0.3,1,0.5
0.6,0.7,1
Normally, the prime use of Tableau is display an aggregated summary of the data, not to display each individual data row. So you can put measure_names on columns and measure_values on the text or label shelf to get a summary of each measure (by default a sum)
If all you want to do is to view the underlying data rows in a table for diagnostics, the easiest way is to use the view data button or menu command.
If you want to build a visualization that displays all the data (without summarizing it) in a table, you have two ways to go. The simplest is if you have a unique primary key in your data, you can place it on the row shelf to get a row in your viz for each row in your data.
If your data rows do not have a primary key, you can turn off aggregate measures from the Analysis menu, but then you'll see multiple values in each table cell. Then to get a row in your viz for each row in your data, put the calculation index() on the rows shelf and change it to discrete.

Hive: How to have a derived column that has stores the sentiment value from the sentiment analysis API

Here's the scenario:
Say you have a Hive Table that stores twitter data.
Say it has 5 columns. One column being the Text Data.
Now How do you add a 6th column that stores the sentiment value from the Sentiment Analysis of the twitter Text data. I plan to use the Sentiment Analysis API like Sentiment140 or viralheat.
I would appreciate any tips on how to implement the "derived" column in Hive.
Thanks.
Unfortunately, while the Hive API lets you add a new column to your table (using ALTER TABLE foo ADD COLUMNS (bar binary)), those new columns will be NULL and cannot be populated. The only way to add data to these columns is to clear the table's rows and load data from a new file, this new file having that new column's data.
To answer your question: You can't, in Hive. To do what you propose, you would have to have a file with 6 columns, the 6th already containing the sentiment analysis data. This could then be loaded into your HDFS, and queried using Hive.
EDIT: Just tried an example where I exported the table as a .csv after adding the new column (see above), and popped that into M$ Excel where I was able to perform functions on the table values. After adding functions, I just saved and uploaded the .csv, and rebuilt the table from it. Not sure if this is helpful to you specifically (since it's not likely that sentiment analysis can be done in Excel), but may be of use to anyone else just wanting to have computed columns in Hive.
References:
https://cwiki.apache.org/Hive/gettingstarted.html#GettingStarted-DDLOperations
http://comments.gmane.org/gmane.comp.java.hadoop.hive.user/6665
You can do this in two steps without a separate table. Steps:
Alter the original table to add the required column
Do an "overwrite table select" of all columns + your computed column from the original table into the original table.
Caveat: This has not been tested on a clustered installation.

Resources