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
Related
When developing a query in Power BI with a database data source, making any changes causes the query editor to 'start from scratch' and re-query the database.
Wondering if there is a workaround that allows you to develop a query without repeated long wait times by eg downloading a temporary local flat file of the full dataset which can be used to develop the query offline and can then be swapped out for the live database connection when you are happy with it.
Importing the data once, exporting as a csv from a Power BI table visualisation and re-importing as a new data source would work but maybe there's a simpler way?
Thanks
There's two approaches you can use.
If your database supports query folding, make the first step take just the top 200 records whilst you develop your query. Once your happy with it, remove the firstN filter.
Load the entire table to the model, export it to a csv using DAX studio, develop your query using the CSV and then switch back to the DB once you're happy with it.
I have a power bi report that connects to another power bi dataset.
I want to import an excel file into the new report's dataset without making any changes to the original dataset.
On this new report (that uses another dataset) the transform query button is grayed out so I'm not sure how to import an excel file. Does power bi support this?
Use the Get data button on the home tab. Should be a simple upload of the excel file. Make sure to use the desktop version. Using the model tab on the far left side you can link variables (many to many, many to one, etc.) (if the datasets are related)
What you`re looking for is a Composite Model. If you want to use it, you first have to enable the following Preview features in Options:
After a restart you can click on Transform data and Power BI will add a local model and allow you to add further data sources like Excel files to it.
In Power BI first we get source data. And then we add multiple query steps to filter data/remove column/etc. Then we add relations and model the data.
We can have calculated columns that are stored in the data. And measures that are not stored in the data but calculated on the fly.
Which data is stored in Power BI - the one after query or the one after modelling?
Power BI has 3 connection types for data access. They are import, direct query and live connections.
If we use import method as a connection type, data imported into Power bi file using Power BI desktop. So all the data always stays in disk. When query or refresh, data stays in computer memory.This data we can use to query and modeling. After work, we save the Power BI file it will save as file with .pbix extension. Data compressed and stored inside this file.
in direct query mode , data stays in remote location and we can connect data. each time we refresh or make change in slicer request goes to data source and bring back data to power bi. In this method, we can't access data but we can create data model.
live connection is another method. It only support for few data sources. In this method, data not stored in computer memory and can't create data model using Power BI desktop.
Power BI is very well documented. Many of the questions you've recently asked are answered in that resource, so please take a look. I get the feeling that you are using this community because you don't want to read the manual. I strongly suggest you take a look at the documentation, because everything we write in answer to your questions has already been written and documented, and SO is not meant to be a shadow user guide for well documented systems.
Depending on the data source you use in Power BI Desktop, Power BI supports query folding, which will do as much processing of the data at the source (for example SQL Server).
If query folding is not possible because the source does not support it, then the source data is loaded before the query steps are applied.
Read more about query folding here: https://learn.microsoft.com/en-us/power-bi/guidance/power-query-folding
When you perform additional modelling after the Power Queries are loaded, i.e. creating tables with DAX, adding columns, etc., these will be performed when the PBIX file is published to the Power BI service, and they will be performed each time the data is refreshed with the data gateway.
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?
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.