Refresh connection from dataset to dataset

Hi @sam.mckay,
I have a report connected to dataset A that is connected to a SQL to pull data, and to another dataset B. This solution was designed since dataset B uses a connection to a slow API and I needed to decouple from dataset A which requires to be refreshed hourly.
Said that when I make some changes to dataset B the only way to see these reflected in the report is to open the pbix used to generate dataset A and run a full refresh. This is a very long operation since data pulled from the SQL is pretty big.
Is it possible to trigger the refresh in dataset A only for the connection to dataset B?

Thanks for help


@Roberto How comfortable are you with PowerShell or C#? And is the workspace a Premium one?

Hi @AntrikshSharma, I’m not fluent in PowerShell but it doesn’t scare me. Workspace is Premium


# Microsoft.AnalysisServices.Tabular = Tabular Object Model library available when you install Power BI, SSAS etc

$ServerXMLA = "powerbi://"
$UserName = "PBI Service user Email"
$UserPass = "PBI Service user passs"

$ConnectionString = "DataSource=$($ServerXMLA);User ID=$($UserName);Password=$($UserPass)"

$Server = New-Object Microsoft.AnalysisServices.Tabular.Server

$Database = $Server.Databases.FindByName("Contoso 500K")
$Model = $Database.Model

# Refresh single table
$ProductsTable = $Model.Tables["Products"]
$ProductsTable.RequestRefresh("Full") #ClearValue, Calculate, DataOnly, Defragment, Automatic
Write-Output $Model.SaveChanges().XmlaResults

1 Like

@Roberto I forgot to mention that the easiest way of refreshing a single table is to use SQL Server Management studio.

1 Like