{"id":921,"date":"2021-02-13T21:37:51","date_gmt":"2021-02-13T19:37:51","guid":{"rendered":"https:\/\/www.flip-design.de\/?p=921"},"modified":"2021-02-13T21:39:33","modified_gmt":"2021-02-13T19:39:33","slug":"organize-and-monitor-the-power-bi-scheduled-refreshes","status":"publish","type":"post","link":"https:\/\/www.flip-design.de\/?p=921","title":{"rendered":"Organize and monitor the Power BI scheduled refreshes."},"content":{"rendered":"\n<p>With Power BI you can set up a scheduled refresh of any dataset which have an accessible data source. But you must be aware of, how many refreshes are at the same time. With every particular capacity you have only limited parallel refreshing resources. So, you can only refresh one dataset at the same time when you use an A1 capacity, up to 24 datasets when you use an P3 or A6. To manage this, it can be very hard, because it is mostly impossible to overview every workspace and if your users manage this, it is impossible!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-4.png\"><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"335\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-4.png\" alt=\"\" class=\"wp-image-922\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-4.png 605w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-4-300x166.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-4-500x277.png 500w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/a><figcaption>Source: Admin in a Day, Microsoft<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-5.png\"><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"334\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-5.png\" alt=\"\" class=\"wp-image-923\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-5.png 605w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-5-300x166.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-5-500x276.png 500w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/a><figcaption>Source: Admin in a Day, Microsoft<\/figcaption><\/figure>\n\n\n\n<p>But you can create an overview with the Power BI REST API by using PowerShell. In my example I created a workspace named \u201cTest\u201d with two datasets which have configured a scheduled refresh. The following PowerShell script calls the REST API and filters all workspaces and datasets in you tenant by a configured scheduled refresh.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-6.png\"><img decoding=\"async\" loading=\"lazy\" width=\"321\" height=\"527\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-6.png\" alt=\"\" class=\"wp-image-924\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-6.png 321w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-6-183x300.png 183w\" sizes=\"(max-width: 321px) 100vw, 321px\" \/><\/a><\/figure>\n\n\n\n<p>The data from the following script will be written into a CSV file. The days and times which are configured to each dataset will be written comma delimited into one column. This can be split off with Power Query by using \u201cSplit into Columns\/Rows\u201d. I think this easier as writing one row for each day.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"has-inline-color has-light-gray-color\"># if you are not authenticated, uncomment following two lines\n\n#$myCred = Get-Credential\n#Connect-PowerBIServiceAccount -Credential $myCred\n\n$Workspaces = Get-PowerBIWorkspace\n\n$ExportFile = 'c:\\temp\\ex.csv'\n\nforeach($workspace in $Workspaces)\n{\n$DataSets = Get-PowerBIDataset -WorkspaceId $workspace.Id | where {$_.isRefreshable -eq $true}    \n    foreach($dataset in $DataSets)\n    {\n        $URI = \"groups\/\" + $workspace.Id + \"\/datasets\/\" + $dataset.id + \"\/refreshSchedule\"\n       \n        $Results = Invoke-PowerBIRestMethod -Url $URI -Method Get | ConvertFrom-Json\n        if($Results.enabled -eq $true) {\n            $days = $Results.days -join ','\n            $time = $Results.times -join ','\n            $row = New-Object psobject\n            $row | Add-Member -Name \"Workspace\" -Value $workspace.Name -MemberType NoteProperty    \n            $row | Add-Member -Name \"Dataset\" -Value $Dataset.Name -MemberType NoteProperty   \n            $row | Add-Member -Name \"Days\" -Value $days -MemberType NoteProperty \n            $row | Add-Member -Name \"Time\" -Value $time -MemberType NoteProperty         \n            $row | Export-Csv -Path $ExportFile -Append -Delimiter ';' -NoTypeInformation  \n        }\n    }\n}\n<\/span><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-7.png\"><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"69\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-7.png\" alt=\"\" class=\"wp-image-925\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-7.png 605w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-7-300x34.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-7-500x57.png 500w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/a><\/figure>\n\n\n\n<p>After creating the Dataset with Power BI Desktop, you can analyze the configured refreshes and check how many are at the same time and reconfigure some datasets.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-8.png\"><img decoding=\"async\" loading=\"lazy\" width=\"493\" height=\"211\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-8.png\" alt=\"\" class=\"wp-image-926\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-8.png 493w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/02\/image-8-300x128.png 300w\" sizes=\"(max-width: 493px) 100vw, 493px\" \/><\/a><\/figure>\n\n\n\n<p>You can automate this with Azure Function Apps and write this file into a Blob Store to get automatically Power BI reports with actual data on you tenant. Also, it should be a good idea to get the refreshing duration of each dataset into this report to organize this a little bit better.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Power BI you can set up a scheduled refresh of any dataset which have an accessible data source. But you must be aware of, how many refreshes are at the same time. With every particular capacity you have only &hellip; <a href=\"https:\/\/www.flip-design.de\/?p=921\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/921"}],"collection":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=921"}],"version-history":[{"count":2,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/921\/revisions"}],"predecessor-version":[{"id":928,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/921\/revisions\/928"}],"wp:attachment":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}