In Power BI dataset, you could use PowerShell to refresh the dataset. Here is the sample script to refresh Here is the script to refresh dataset named “MyReport” inside workspace named “My Workspace”.
$User = "admin@mycompany.com"
$PW = "password"
$SecPasswd = ConvertTo-SecureString $PW -AsPlainText -Force
$myCred = New-Object System.Management.Automation.PSCredential($User,$SecPasswd)
Connect-PowerBIServiceAccount -Credential $myCred
# Get Power BI Workspace ID
$WSID = Get-PowerBIWorkspace -Scope Organization -Name 'My Workspace'| ForEach {$_.Id}
# Get dataset ID
$DSIDRefresh = Get-PowerBIDataset -Scope Organization -WorkspaceId $WSIDAdmin | Where {$_.Name -eq "MyReport"} | ForEach {$_.Id}
$RefreshDSURL = 'groups/' + $WSIDAdmin + '/datasets/' + $DSIDRefresh + '/refreshes'
$MailFailureNotify = @{"notifyOption"="MailOnFailure"}
Invoke-PowerBIRestMethod -Url $RefreshDSURL -Method Post -Body $MailFailureNotify
Please note after refresh done from PowerShell, if you look at the refresh history, you will see the refresh type is empty. It seems like Power BI could not decide if the refresh is done by on demand or Scheduled.