I'm trying to get a dataset parameters.
I'm using a local Excel Workbook file and upload it to PBI.
Then I try to get dataset params as mentioned here
When I make a request I don't have any params back.
Is it the right API ? I expect to get columns names as result.
The Datasets - Get Parameters In Group is not the right API. This API will return a list of parameters for the specified dataset from the specified workspace.
This won't return the data of the actual dataset, which is what you are looking for. Unfortunately this is not a support scenario with Power BI. Why do you need to retrieve the content of the Excel file programmatically?
Related
I'm trying to import JSON data from a URL (https://www.mapping.cityoflondon.gov.uk/arcgis/rest/services/COMPASS_Epping/MapServer/9?f=pjson)
into Power BI.
I click on Get Data -> URL -> put URL into "Basic" and get the following:
screenshot
The data imported into Power BI is not usable in this form. How do we parse the data as we import from the URL?
By looking at the screenshot you shared, it seems after using the web connector, Power Query is reading the data as a CSV file.
CSV.Document
You can
Go to Source step in Power Query
In formula bar, replace CSV with JSON. Formula for Source step should look like
= Json.Document(Web.Contents(URL))
Now Power BI will read it correctly as a JSON List. You can use the Into Table option to convert the list to table and make it more usable.
JSON list to table
Now I am not sure how do you want to see the data and you will be using it, but the above steps should make the data usable enough to perform any further transformations further on it and make use of it.
example
The PowerBI connector doesn't work, since it defaults to the IE browser, and our IE browser is locked down by our IT department (can't connect to smartsheet site). So, I need to use the "web" API option to get my smartsheet data. I have the data coming in, but I'm brand new at this and I'm having trouble organizing it. I have 8 columns that are repeating as rows, and the cell data contains a bunch of metadata values that I don't want. How do I get this so the columns become columns again, with the cell data as rows (with just the face values) and not repeating?
screenshot of data in PowerBI
I think you need to read a good part of the documentation in order to get used to the responses you get from Smarsheet, in brief you get a Json data structure.
First read, https://smartsheet-platform.github.io/api-docs/#how-to-read-a-sheet-response
Then you need to make the json connection to PowerBI like this example, https://www.mssqltips.com/sqlservertip/4621/using-power-bi-with-json-data-sources-and-files/
I have created a data flow.
Then created a dataset that uses the dataflow as data source.
Then I tried editing the dataset to a point to a different dataflow, however there isnt an option to change to a different dataflow.
How to modify a dataset's dataflow in Power BI?
The M code genderated when loading data from a Power BI Dataflow looks like this:
let
Source = PowerBI.Dataflows(null),
#"Long-Workspace-Id" = Source{[workspaceId="Long-Workspace-Id"]}[Data],
#"Long-Dataflow-Id" = #"Long-Workspace-Id"{[dataflowId="Long-Dataflow-Id"]}[Data],
#"Sample Data1" = #"Long-Dataflow-Id"{[entity="Sample Data"]}[Data]
in
#"Sample Data1"
With ID values that look like this fake ID string: 68920386-482d-445e-9725-839065646dde.
So, you just need to figure out the ID values for the dataflow you do want to connect to and swap them out.
One way to find these IDs would be to connect to the other dataflow in another Power BI instance and copy the values from the query editor in that one over to the original Power BI instance.
The IDs are also contained in the URL when you navigate to the dataflow within the workspace that it lives in. The URL looks like
https://app.powerbi.com/groups/long-workspace-id/dataflows/long-dataflow-id
Is it possible to change SQL statement of the dataset via API call?
My Scenario: I have data in multiple tables in SQL Server. I have created a SQL query with joins to fetch the required data. I created a SQL server dataset by providing that query in the SQL Statement section and published it on the Power BI workspace. Now, I want to modify that SQL Statment programmatically.
I want to import this same .pbix file to create different datasets. The Idea is to use import date set api to import this dummy dataset and then programmatically change the db source and the SQL Statment, to customizes it for my different report need.
Any pointer or help is much appreciated.
For server name and database name, you can simply use parameters. Click the button to the left of the field to do this. You can make some changes in the query using parameters too, but this isn't very flexible. This can be done by defining text parameter and using it in in the M statement associated with the dataset’s Source step. For more information you may see this article:
https://www.red-gate.com/simple-talk/sql/bi/power-bi-introduction-working-with-parameters-in-power-bi-desktop-part-4/
Then you can use the Rest API to modify parameter values and refresh your datasets. You will need Update Parameters In Group and Refresh Dataset In Group API calls.
At of this writing, this is not supported by the Power BI REST API.
Possible workaround: Given you're using SQL Server, I'd suggest you create a VIEW in SQL Server with the statement you defined in your Power BI report, and change your report to point to that view instead.
Then, to modify the SQL statement, you just have to ALTER the view in the database.
I want to generate a power bi report that will accept a parameter of its dynamic query from user and process the data based on new user Input, is there any possible way to achieve this in power bi desktop?
Pre-Requisite
I am using a data source “http:link.com/{new file name}” where {new file name} is the user input I am accepting from the user.
Data is saved online in csv format and not in power Bi, will be fetched on the execution of query.
What I am able to do
I have created a query that works on data modification in my desired manner, I have to manually update the file name in link used in query, then I have to manually generate the visualization for it which makes it a 3 step process
What I want to do
I want the above manual interaction to be as minimum as possible
If possible, create a dynamic query/ function which will accept the new file name and will apply the query for data modification and based on that data generate the data insight/visualization.