How to Save user slicer selection on powerBI - powerbi-desktop

I need one help, I have one powerBi report which contains 5 slicers on this. so I want when user select any slier that time this selection need to save and when next time user open this report, earlier selected slicer need to set and open the report.
so, I need help for how to save selected slicer option on slicer when next time user open the report, earlier selected slicer need to set on report and report open.

Related

How to Get Data on Close Workbook Table on Excel VBA without Openning It?

I have three Workbook,
First is for my Inventory System for Admin,
Second is my Inventory System for Employees, and
Third is my Database.
Does anyone know how to get Data Table on Database without Opening it and put it either in Admin or Employee's Inventory System?
All you need to do is go to "Data" tab in ribbon > Get Data > From File > From Workbook. Then open the "Database" excel file.
This will allows you to preview the data from the "Database" sheet. If you don't need to make any changes you can click load directly and the data will be copied.
You can check out this video for more examples on how to use Power query.
I also recommend checking out this video on how Power Query can help you.

Stop updating PowerPivot when opening Worksheet

I have an excel workbook that is to be used as a report, that is distributed to different people. The workbook gets data from an input file (another Excel file) that is not available to all the people who are receiving the report.
My problem is, that when the people who does not have access to the input file opens the report, the workbook tries to update the data, but fails, as the user does not have access to the input file. Is there a way to stop the sheet from auto-updating when it is opened?
Based on the versions of excel I have used, Excel 2013 and 2016 that does not sound like the standard behavior I have seen.
There would be a couple things to check:
1) Is there macros in the file, which run on open and force refresh. VBA command to refresh a data model being the following ThisWorkbook.Model.Refresh
2) Right click on the pivot tables --> Pivot table settings --> Data, check if refresh data when opening the file is selected. Not sure on this one but it might be forcing a refresh of the model.
3) If you are using power query, open the queries & connection tab, right click each query and select properties. There is an option for Refresh data when opening the file.

how to remove the source column from sheet after creating the dropdown in excel

I have created the dropdown using data validation from other column which contains more than 30 values in excel. I need to send the excel to user to enter the data but the source field for dropdown should not be shown to user .can you please assist me how to achieve this?
Hide the sheet containing the list used for the dropdown.
If you switch to the VBE you can even set the worksheet.Visible property as veryHidden: that way users can't even see it's hidden and can't unhide it.

Excel: Automatically update unshared PivotTables without ungrouping fields

I have some very simple code to automatically refresh my pivot tables when the data source is updated:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet2.PivotTables("PivotTable1").PivotCache.Refresh
Sheet3.PivotTables("PivotTable2").PivotCache.Refresh
Sheet4.PivotTables("PivotTable3").PivotCache.Refresh
End Sub
Whenever it refreshes, my fields ungroup. For example one is in months the other is in weeks, etc. but when it refreshes they all ungroup and show each individual date. Any ideas?
One thing you can do is to record a macro that groups the data into the format that you want. Then copy the macro section that groups the selection after each pivot table refresh command. So essentially you refresh and regroup each time.
A link that shows how you can use VBA to group pivot table data is http://www.ozgrid.com/forum/showthread.php?t=55370
I hope this helps

Excel 2010 - Change data source of pivot table from external to worksheet within workbook

I have been having problems with a pivot table that uses an external .csv file as its source, particularly with dates in the csv file being treated as text. So, I decided to import the csv file into another worksheet and then force the dates to be recognised as such by reformatting the relevant columns.
The problem I now have is changing the existing pivot table to use the data in the new worksheet instead of an external source. If I click on "Change Data Source" button, the "Select a table or range" option is greyed out. If I continue with external data source and click the Choose Connection button and select the new worksheet I get a pop up that says "The type of connection selected cannot be used to create a PivotTable".
I also tried converting the csv file to xlsx but had a similar problem trying to get the existing pivot table to use it instead of the csv as its source.
It's been a while since you asked, but I had this same problem and just discovered a solution.
Basically, you can use VBA to change pivot tables to a new pivot cache. If the new cache uses the same fields then your layout will be preserved.
Create a new pivot table based on the new data source (it can just be empty).
Click in the new pivot.
In the immediate window type "? selection.pivottable.cacheindex" and press enter.
Note the index number of the pivot cache.
In Excel click in the old pivot which you want to change.
In the immediate window type "selection.pivottable.cacheindex = x" where x is the index number you noted in step 4.
Repeat step 6 for every pivot table which you want to use the new source.
Remove the table you created in step 1.
There may to change all tables from one cache to another in a single step, but it's probably not something you need to do often.
Yes, that is an annoying constraint for pivot tables.
Steps to recreate the and change the datasource from .csv to .xls file:
Created a .csv file with headings Name, Birthdate, Sign. Closed the file.
Imported the .csv into a new pivot table PivotTable1 in a new workbook.
Saved the orignal .csv into a new workbook c:\path\to\datasource.xls, naming the worksheet Data and making sure the upper left cell of the data range was in cell A1.
Then I added the following VBA macro and executed it:
Sub getExcelData()
With ActiveSheet.PivotTables("PivotTable1").PivotCache
.Connection = Array( _
Array("ODBC;DSN=Excel Files;"), _
Array("DBQ=c:\path\to\datasource.xls;"), _
Array("DefaultDir=c:\path\to;DriverId=790;MaxBufferSize=2048;PageTimeout=5;") _
)
.CommandText = _
"SELECT `Data$`.Birthdate, `Data$`.Name, `Data$`.Sign" & vbCrLf & _
"FROM `c:\path\to\datasource.xls`.`Data$` `Data$`"
End With
End Sub
The .CommandText syntax for this driver is horribly picky and not at all smart.
YMMV with this code in 2010 or later and/or with different drivers. Date and numeric data are notoriously ill-handled even in later versions of Excel data drivers. I generally make sure that every cell in a numeric or date field has a valid value, or at the very least every cell in the first row of data, before importing.
This helps but for those who dont know where is immediate window you need to go to developer tab and get in the Visual basic Macro window and press Ctrl+G it will open the immediate window at the bottom. Original answered by mendosi It's been a while since you asked, but I had this same problem and just discovered a solution. Basically, you can use VBA to change pivot tables to a new pivot cache. If the new cache uses the same fields then your layout will be preserved.
Create a new pivot table based on the new data source (it can just be empty).
Click in the new pivot.
In the immediate window type "? selection.pivottable.cacheindex" and press enter.
Note the index number of the pivot cache.
In Excel click in the old pivot which you want to change.
In the immediate window type "selection.pivottable.cacheindex = x" where x is the index number you noted in step 4.
Repeat step 6 for every pivot table which you want to use the new source.
Remove the table you created in step 1.
There may to change all tables from one cache to another in a single step, but it's probably not something you need to do often.
Since I'm a new member, I can't add comment nor add vote.
Anyway as I found this page because I have the same problem,
to me, the answer from Ines is correct and the easiest one.
Excel 2010:
Customize The Ribbon....
Commands not in the Ribbon...
PivotTable and PivotChart Wizard...
Add number-3 as new menu (I choose as new menu in the INSERT tab)
Click the Pivot Table which data source need to be changed from external connection to a range or table in the active worksheet.
Click number-3 menu
Click "back" twice
Choose Microsoft Excel List or Database radio button
click "next" then fill the range or the named range in the range-box
Click FINISH
There I can finally change it from external data to a range
Thank you very much, Ines.
(Don't know why someone down voted you).

Resources