How to merge (append) data from 2 live models? - powerbi

I have 2 datasets deployed to power bi portal.
On a report I can connect to 1 dataset using live connection, and then convert the connection to DQ to also connect to the 2nd dataset.
Then I can create relationship between the model travels. How to merge (append) data from 2 live models?

Today you can't.
You can leave the tables separate and write DAX measures that operate over both tables.
But if you try creating a DAX calculated table that appends the two, refresh will fail in the service, as this scenario is not currently supported.
Instead of using Direct Query to Power BI Datasets, if the Datasets are on Premium Capacities, you can import tables from both models using the Analysis Services data source and an explicit DAX query. eg
let
Source1 = AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/someworkspace", "AdventureWorksDW", [Query="evaluate DimCustomer", Implementation="2.0"]),
Source2 = AnalysisServices.Database("powerbi://api.powerbi.com/v1.0/myorg/someworkspace", "AdventureWorksDW2", [Query="evaluate DimCustomer", Implementation="2.0"]),
Appended = Table.Combine({Source1, Source2})
in
Appended

Related

Power BI Paginated report using power BI dataset from multiple azure sql servers

Just looking for a pointer as to the best way to go about this.
I'm comfortable with Power BI Report Builder (SSRS experience), but am pretty much a Power BI novice.
Basically, we have to create a Paginated (non-interactive) report for client consumption. It's going to be large, have multiple datasets, and use parameters / presence of data in the data sets to group data and/or turn sections on or off.
Not too much visualisation - some illustrative graphs and tables here and there - and quite a bit of text, some of it with data / text inserted via placeholders from the various datasets.
There are 3 Azure SQL databases I need to combine data from for this, (split roughly into config, data and results).
In SSRS / SQL Server, I would have used one of my databases as the data source, and written a stored procedure per SSRS data set, joining to tables in other databases in the stored procedure query.
Then in Report builder just set up the data sets joining to the stored procs and gone from there.
On Azure SQL Server, I think I've got 2 options:
write elastic queries so I can bring in the data I need from each database, but just query on one database.
Build a Power BI Model / Dataset that joins the relevant tables from the 3 databases together, publish to power bi service and use that as my datasource.
What's the best solution for my reporting scenario?
Cheers

What is the approach to merge data from multiple databases (same schema) using Power BI?

I have 3 OLTP databases, all using the same database schema. Each db represents one department.
I am exploring Power BI as a solution for reporting at the company level, so all departments combined.
What is the approach to combine data from multiple dbs into a data warehouse? For example - do I need SSIS to combine the 3 dbs into 1 data warehouse?
Another option could be to have 1 shared dataset per db, and then the final report can connect and combine multiple live datasets? Or is there another way with Power BI like combining multiple live datasets?
Any reference link on how if someone has done this?
Or is there another way with Power BI
Yes. Simply create a single import model and load data from all three databases in it. So for each table in your Power BI model you would have three Power Queries set to not load into the model, and you would append them in a query that is used to load your model. See eg: https://learn.microsoft.com/en-us/power-query/append-queries
Best practice would be to:
Extract the data into a single database (DWH or reporting schema)
Build the necessary items there for your data model, be it reporting schema, or star/snowflake schemas
Connect Power BI to that schema.
Combining datasets is going to be tricky, you may have the same measures in each of the datasets. Combining in the database, with any added columns to indicate the department is the best option in terms of supporting updating/adding/removing items. For example, if the schema changes in the DB's you do it in one place, not three datasets. The toolset in DB/SSIS will be better suited to the heavy lifting of the data to a location.
You would use SSIS to extract the data if on-prem data, Azure Data Factory for Azure DB's. Extract to a staging schema, convert/transform the data into its final from, with a new schema to define what it is, facts/dimensions other schema names such as reporting can be used, depending on the data model you wish to build. Most of this is covered by the standard ETL pattern of OLTP to an OLAP database.

Does power bi have capability to have a dataset or report that connects to 2 datasets?

I am exploring the following:
I have a power bi report with data model in the same file.
I can separate the report into one file and dataset into another file, and have a live connection from report to dataset.
Recently a new feature is introduced wherein I can create a dataset (D2) which can make live connection to another dataset (D1), and the connection gets converted from live into DQ connection, and then in this dataset (D2) I can add new data sources to improve my model. Reports can connect using live connection to any dataset (D1 or D2).
Does power bi have capability to have a dataset or report that connects to 2 datasets?
A report can only connect to one dataset, but multiple dataflows.
However, maybe
Use composite models in Power BI Desktop can solve your problem.

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

Can a data source have multiple servers connection string in Power BI?

I have multiple databases which have similar schemas. I need to combine the data from all these databases and do reporting over it.
For example -
Customer table in AdventureWorks in Server 1
Customer table in AdventureWorks in Server 2
Customer table in AdventureWorks in Server 3
Now in Power BI i will have a data set called Customer. The data for this needs to come from all the 3 servers mentioned above. I know I can do it using merge queries in Power BI but it means I will have to pull the data from different server as different datasets in power bi and merge which I want to avoid.
Do let me know if there is any other way to do this.
You must use Edit queries -> Append queries (or Append queries as new) to combine the data from these data sources into one table:
I find Append queries as new more meaningful in this case. It will create a new (fourth) table, which will contain all the rows from the other 3 tables. Select Three or more tables and select all customers tables from your data sources:
Then use this new table in the report.
You should not worry that duplicating the data will lead to increased size of the data. The data itself will be reused and not copied twice.
Your model is the right place for combining data from different data sources in one place. Maybe this should not be your report, but one dataset shared between your reports, or a SSAS model. Combining the data on SQL Server level (e.g. partitioned view over 3 databases) is not a good idea. Combining these in your model also gives you the option to combine data from different types of data sources, e.g. Customers 1 is in SQL Server, Customers 2 is .csv file in OneDrive and Customers 3 is coming from a web service call.