Change from "Import" to "Direct Query" in Power BI - powerbi

I have 2 Queries in Power BI
one is Import and the other is Direct Query
I was looking at the Advance Editor for both queries.
they both look exactly the same, no difference what do ever
How can I change Import query to become Direct Query from the Advanced editor?
Import query script
let
Source = Sql.Database("DSServer", "DSDB", [Query="EXEC stat_DailyNumbers"])
in
Source
Direct Query script
let
Source = Sql.Database("DSServer", "DSDB", [Query="EXEC stat_DailyNumbers"])
in
Source

You cannot switch between query methods.
Workaround:
1. copy the code from your advanced editor to notepad.
2. Create a new query, where you will be able to choose direct query / import.
3. Open advanced editor for the new query and paste the code you copied earlier.

Related

Power BI changing data source from CSV to folder while keeping all measures

I have a Power BI report where I load data from a CSV into a table (Original Table). I want to change the source of the table to a folder that contains multiple CSVs. The issue i'm having is that when I go to change the data source settings of my Original Table I cannot change it to folder. Original Table has many measures and I would like to avoid rewriting them all. Any ideas?
Create a new query that reads multiple csv from a folder and combines them.
Make sure the column names are the same as in your original table.
Open both queries in the advanced editor and copy the whole code from the new query to the old query
Delete the new query

Power BI Report - Add Drop-down selection Or Add Free Input Text to table row

I have just created a table in Power BI Report view (After creating my data set). I now need to create either a drop-down selection of 2 options or a text input into the table row.
Example:
Column 1 = Project | Column 2 = Project Name | Column 3 = Required Input Box
Project A | Best Project | Drop-down Selection / Free text input
Is there any way for me to accomplish this in Power BI?
Thank you all in advance.
This is not how PowerBI and reporting works.
You're misunderstanding Frontend with Reporting.
Once data is imported in Direct Query / Import Mode (if you're in Desktop PowerBI) you can only transform it by using DAX or M queries, but appending data to report dynamically is not a feature of PowerBI.
But, you can upload an excel on Sharepoint and then set your dashboard data source to the sharepoint link, this could be your hack to achieve what you're trying to do.
There is no actual way to edit data in power bi, you may use power automate to append your data source.

How to copy a table definition (including hierarchies & measures) from one Power BI Report to another report within Power BI Desktop

Is it possible to import or copy a table definition from one Power BI report to another report, within Power Bi Desktop.
So from one Power BI report copy the following to another report:
Source query which defines the table (i.e column types, data source etc.)
Any hierarchies defined within the table
Any Measures attached to the table
The contained data isn't important rather its the definition I would like to transfer.
Hopefully, this is all done without basically manually recreating each part.
I would be happy if this as simple copying a M-Query/DAX script between report and running it.
I have tried using a Power Bi templates, but this only seem to be useful as starting point in creating a report as it always creates a new report. I am looking for some way to transfer definitions between already created reports.
Until now (as far as I now) its just possible to copy everything what was done in the query designer to another report.
Go to Edit Queries click on your table on the left side, which you want to copy and go to Home > Advanced Editor. Copy the whole text.
Now in your other report add a blank query in your query designer, then go to the advanced editor and hit insert. If nothing changed (soure path, file name, etc...) you will have the same table with the applied steps as in the other report.
It's only a partial solution, but you can very easily copy/paste entire queries between reports. It doesn't get measures and DAX columns, though.
Source report -> Query Editor -> Queries pane on left -> Right click source query -> Copy
Destination report -> Query Editor -> Queries pane -> Left click -> Paste

Power BI - Can I run multiple queries on Power BI desktop during importing? Is that a bad design?

I'm using Power BI to display a number of reports for my business.
For each report, I have a sql query and will use the 'Import Data' function to load the data for each report.
E.g
This is the query for the report data that I want to load and it will be e.g report 1 :
select *
from employee_name_and_salary
where salary<100;
I would like to store the data from each run of report 1 into a table so I can use it for historical data reporting of report 1.(I will do this for a number of reports ~100)
So in the import query I would like to use the following statement:
insert into report_history
select *
from employee_name_and_salary
where salary<100;
select *
from employee_name_and_salary
where salary<100
;
Please could you let me know if this ok? Will insert statement take space on the PBIX file?
Thank you!
You should handle the INSERT in your database prior to pulling the data into the .PBIX i.e. create a stored procedure or something to handle that process. Once this has been set up you can just select * from that table in your .PBIX.

Automate the Export from Power BI to Power Point

I have a data set that it transformed in SQL Server and then sent to Power BI. The report is built to specs of marketing people so i cannot move to excel (needs to be pretty).
Has anyone set up a procedure to automate the export of a PBI report (filtered by a specific column) and then converted to PDF? To clearify, the data set has performance metrics of say 15 locations and i need a report for each location.
Steps:
1) data is loaded in aggregate
2) filter applied by location
3) calculated fields populated (charts etc.)
4) exported to PPTX then converted to PDF (would love to automate this step)
5) Need to remove links to PBI from PDF (no quick way found yet)
6) go to PBI and set the filter to next location and repeat
Any advice would be appreciated!
How would you feel about just screen-shotting the PBI report and creating a PDF/PPTX file out of that?
You can also print direct to PDF:
Print -> Print to PDF as 'printer'
I hope I don’t break any rules for saying this but our software,PBRS, is just the answer for this. Our data-driven schedules can run the Power BI reports with one or more filters applied and export it to PDF, PowerPoint, Excel etc. The filter values can be pulled from a database list as you described.
Check it out at
https://go.christiansteven.com/power-bi-reports-scheduler-power-bi-reports-distribution-pbrs