Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a command to refresh power BI tables. #4

Open
metamoof opened this issue Sep 4, 2018 · 1 comment
Open

Create a command to refresh power BI tables. #4

metamoof opened this issue Sep 4, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@metamoof
Copy link
Owner

metamoof commented Sep 4, 2018

This suite needs a command to refresh the table.

There is code to do this using AMO on Salvador's update script, which I have pasted below

There probable needs to be a -Save switch.

    #  Connect using AMO thanks for stackexchange Smiley Happy

    log_message "Connecting to PBI using AMO"
    [System.Reflection.Assembly]::LoadFile("C:\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies\Microsoft.AnalysisServices.tabular.DLL")
     ("Microsoft.AnalysisServices") >$NULL
    $server = New-Object Microsoft.AnalysisServices.tabular.Server

    $server.connect($dataSource)
    $database = $server.Databases.Item($Database_Name)


    #Refreshing Bower BI (thanks to Marco russo http://www.sqlbi.com/articles/using-process-add-in-tabular-models/)
    log_message "Trying to refresh Power BI now"
    $model = $database.Model
    $model.RequestRefresh("Full")
    $model.SaveChanges()


    $server.disconnect($dataSource)
@metamoof metamoof added the enhancement New feature or request label Sep 4, 2018
@metamoof metamoof self-assigned this Sep 4, 2018
@metamoof
Copy link
Owner Author

metamoof commented Sep 4, 2018

What to call it though? PowerBIPS calls the online version Request-PBIDatasetRefresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant