How can I generate data insight using dynamic query in power Bi - powerbi

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.

Related

Automate excel file in Power BI when refreshes the report

I need help in below PBI Requirement--
currently, we are using data from one static excel file in Power BI and whenever new changes are require, we edit the excel and save it into update file.
User's requirement is to have a form in power bi in which user can enter the data and it should get updated in the excel and loaded into the power BI.
Please let me know if any one have done this.
Manual I did but Dynamic it is not getting written some M-code and all
Connect your PowerBI dataset having excel data to power Apps(PowerApps visual),powerapps automatically creates a user editable form with available columns or you can create a form according to your requirement which you can access from power bi through powerapps visual.

How to create Power BI dataset (including fact & dim tables, relationship etc.) automatically at scale?

I have a PBI dataset which I created using PBI Power Query on my local laptop.
The PBI dataset modeled the gross data into fact the dim tables.
Let's say that the source data is an invoice table, the power query break the table to fact and dim table, create the connections etc. Then I create a PBI report to visualize this data.
I am looking for a way to create the data model automatically.
As I picture it it will be a JSON file which include the data source parameters (details , credential and other parameters) and a script which include the data model logic as I created on Power Query).
When I get a new invoice table from another data source all I need to do is:
update the JSON file and run the script which will setup the data model automatically.
for example: take the invoice table, create the fact and dim tables ad create the connections.
N problem using other Azure solution such as Azure analytical service etc.
I have the coding skills, so fee free to suggest API all everything.
Thank you, Tal

How to create a filter in powerbi that will dynamically query the db using a SP with a parameter

I am trying to run a direct query on my DB and apply a filter input by the user. The user input would be used as a parameter for my Stored Procedure that retrieves the data I want to display to the user. The reason for running a direct query and not just refreshing the data and then the user filtering from all of that data, is that the database is really large and it would make the report file approx. 650mb in size. My idea is that with a direct query, I can pull only the data required through an indexed column that the Stored Procedure uses to filter.
Currently I was able to create a parameter in the Query editor and use it in a query function but this creates an "Invoked Function" table. If I use these results in my report essentially the user can only filter through the result I filtered in my query editor. I want the user to be the one to input that value and the report to dynamically load it.
As far as the filter field, I am using a slicer and added the search capability to it so they can type out the search value and select the result in the list. Ideally I would like a textbox that they can type the value they want and search for it.
Is this possible in PowerBI? and if so how could I accomplish this?
You have to download a separate application called Power BI Report Builder to accomplish this and create a paginated report. See Url below:
Paginated Reports

Which data is stored in Power BI - the one after query or the one after modelling?

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.

How to model queries in Power BI for daily append of new data instead of overwriting

I'm trying to build a simple report in Power BI based upon data published on a website.
Here is what I want to achieve
This website publishes data for COVID cases in the country.
The number are just the current numbers, without any time-series.
I want to fetch these numbers from this website daily and build a report on
top of it (with time series kind of analysis).
So I fetch these numbers (Get Data > Web > URL) and get this into a query I then add
a custom column with a timestmap (M's DateTime.LocalNow() function)
and get this data with the required timestamp.
Now I want to refresh this query daily, so that I get daily results in this query.
6. As expected, PBI simply overwrites the existing rows with new data,
with the latest timestamp (my custom column).
I tried few things like:-
Creating a new query and appending data to it, it doesn't seem to work, existing data gets over-written (maybe the way I have created the new query).
Explored incremental refresh functionality, it doesn't seem to fit my use case.
Tried looking at other similar posts, none seem to help me resolve this.
Questions:-
Is there a simple workaround to circumvent this (point#7) and have PBI append new data instead of overwriting existing data.
Am i correct on point#2 above (incremental refresh)?
Appreciate any pointers. Thanks in advance!
There is no simple workaround within Power BI.
Power BI is not designed to be used as a database where you store historical data. It's designed to connect to data and create reports from that, so you'll need to store the daily data somewhere external.
There are tons of ways to store the data. E.g., you could save them as CSVs in a folder that Power BI loads from or you could write them to a database table and connect to that.
Edit: That said, there is a non-simple workaround if this is something you really must do.
Though not recommended, you can use incremental refresh to trick Power BI into doing what you want.