PowerBI@1

PowerBI@1 provider lets you test data in locally open Power BI desktop file.

PowerBI@1 provider is meant for interactive testing of an open Power BI file. This means you have to manually open the PowerBI file before testing it.

Example - testing data

Let’s say you have an open file Finance.pbix. In your project file, define a data source like this:

Data sources:
- Name: finance model
  Provider: PowerBI@1
  Connection string: Finance

Note that in the connection string, you only specify the name of the file (without .pbix extension). You do NOT need to care about the analysis services instance running under the hood, its connection string or port. In fact, you don’t even need to know something like that exists.

What you DO need to be aware of is, you can NOT run SQL queries against your model. You need to use DAX. At least very basic DAX knowledge is required.

You can define a simple test that verifies you have data from all states in your model:

Tests:
- Name: Check all states are loaded
  First Data Source: finance model
  First Query: |
    EVALUATE(
    	VALUES('Customer'[State])
    )
    ORDER BY 'Customer'[State]
  Second data source: accounting # let's say you want to compare with a source system
  Second Query: SELECT [StateName] FROM dbo.States ORDER BY [StateName]
  Expectation: sets match