Power BI: Mitä raportteja meillä on? Mistä raporttiemme data tulee?



Install-Module -Name MicrosoftPowerBIMgmt
tekstikenttään, maalataan kyseinen teksti ja aja valinta (Run Selection)



Login-PowerBI
(Valitaan teksti ja painetaan, aja valinta)




Get-PowerBIWorkspace
Saadaan taulukko työtiloista jokseenkin tämän näköisenä:


- Kopioi koko koodi PowerShelliin. (Koodi ohjeiden jälkeen)
- Muuta parametrikohdasta osoitetta niin että se osoittaa omalla koneella olevaan kansioon mihin haluat tallentaa datan.
- Valitse koko koodi ja aja se samoin kuin on edellisissä kohdissa tehty.
- Ajoin aikana ja sen jälkeen pitäisi näyttää tältä:
- Workspace tarkoittaa työtilaa. Merkin" /" jälkeen näkee kuinka monta on viellä jäljellä. RowNbr kertoo montako datariviä on haettu.
- Avaa CSV tiedosto esimerkiksi Power BI:llä kansiosta, jonka määrittelit kohdassa 2 ja selvitä helposti vastaukset otsikossa mainittuihin kysymyksiin.
Koodi
Ohessa on PowerShell koodi, mikä käy läpi kaikki työtilat, niiden datamallit ja datamallien lähteet, sekä kirjoittaa tiedot CSV tiedostoon. #Parameters: $CSV = "C:UsersKristjanVaalberkDesktopAllGroupsDatasetsSources.csv" # location and name for the csv file #Loop All workspaces, datasets, sources and save to CSV "Start Get Datasources" $CountRows = 0 $CountWorkspaces = 0 $workspaces = Get-PowerBIWorkspace -Scope Organization #All workspaces $workspacesTotal = $workspaces.count "Total workspaces :" + $workspacesTotal $GroupDatasetSource = New-Object System.Collections.ArrayList $workspaces | ForEach-Object -Process{ ## for every workspace/groups $Workspace = $_ $CountWorkspaces++ "Workspace: " + $CountWorkspaces + "/" + $workspacesTotal $GroupDatasets = Get-PowerBIDataset -Scope Organization -Workspaceid $_.id ## get all datasets in groups/workspace and save to $GroupDatasets (array) IF($GroupDatasets.count -eq 0) { #group has no datasets $i2 = 0 Do { # Loop all users in group $temp = "" | select "GroupId", "GroupName", "GroupDescription","GroupType", "GroupState", "GroupIsReadOnly", "GroupIsOrphaned", "GroupIsOnDedicatedCapacity", "GroupCapacityId", "GroupUserPrincipalName", "GroupAccessRight" , "Datasetid", "Datasetname", "DatasetaddRowsAPIEnabled", "DatasetconfiguredBy", "DatasetisRefreshable", "DatasetisEffectiveIdentityRequired", "DatasetisEffectiveIdentityRolesRequired", "DatasetisOnPremGatewayRequired" ,"SourceName","SourceConnectionString","SourceDatasourceType","SourceConnectionDetails", "SourceGatewayId","SourceDatasourceId" $temp.GroupId = $Workspace.id $temp.GroupName = $Workspace.Name $temp.GroupDescription = $Workspace.Description $temp.GroupType = $Workspace.Type $temp.GroupState = $Workspace.State $temp.GroupIsReadOnly = $Workspace.IsReadOnly $temp.GroupIsOrphaned = $Workspace.IsOrphaned $temp.GroupIsOnDedicatedCapacity = $Workspace.IsOnDedicatedCapacity $temp.GroupCapacityId = $Workspace.CapacityId IF($Workspace.users.AccessRight.count -eq 1) { $temp.GroupAccessRight = $Workspace.users.AccessRight $temp.GroupUserPrincipalName = $Workspace.users.UserPrincipalName } Elseif ($GroupDatasets.users -eq $null){ $temp.GroupAccessRight = 'NotFound' $temp.GroupUserPrincipalName = 'NotFound' } Else { $temp.GroupAccessRight = $Workspace.users.AccessRight[$i2] $temp.GroupUserPrincipalName = $Workspace.users.UserPrincipalName[$i2] } $temp.Datasetid = 'NotFound' $temp.Datasetname = 'NotFound' $temp.DatasetaddRowsAPIEnabled = 'NotFound' $temp.DatasetconfiguredBy = 'NotFound' $temp.DatasetisRefreshable = 'NotFound' $temp.DatasetisEffectiveIdentityRequired = 'NotFound' $temp.DatasetisEffectiveIdentityRolesRequired = 'NotFound' $temp.DatasetisOnPremGatewayRequired = 'NotFound' $temp.SourceName = 'NotFound' $temp.SourceConnectionString = 'NotFound' $temp.SourceDatasourceType = 'NotFound' $temp.SourceConnectionDetails = 'NotFound' $temp.SourceGatewayId = 'NotFound' $temp.SourceDatasourceId = 'NotFound' $GroupDatasetSource.Add($temp) | Out-Null $CountRows++ "RowNbr :" + $CountRows $i2++ } While ($i2 -le $Workspace.users.AccessRight.count-1) } $GroupDatasets | ForEach-Object -Process{ #for all datasets $Datasets = $_ $DatassetCount = $Datasets.count $Datasets | ForEach-Object -Process{ #all sources in dataset $Source = Get-PowerBIDatasource -DatasetId $_.id -ErrorAction SilentlyContinue $SourceCount = $Source.count $i = 0 Do { $i2 = 0 Do { # Loop all users in group $temp = "" | select "GroupId", "GroupName", "GroupDescription","GroupType", "GroupState", "GroupIsReadOnly", "GroupIsOrphaned", "GroupIsOnDedicatedCapacity", "GroupCapacityId" , "GroupUserPrincipalName", "GroupAccessRight", "Datasetid", "Datasetname", "DatasetaddRowsAPIEnabled", "DatasetconfiguredBy", "DatasetisRefreshable", "DatasetisEffectiveIdentityRequired", "DatasetisEffectiveIdentityRolesRequired", "DatasetisOnPremGatewayRequired" ,"SourceName","SourceConnectionString","SourceDatasourceType","SourceConnectionDetails", "SourceGatewayId","SourceDatasourceId" $temp.GroupId = $Workspace.id $temp.GroupName = $Workspace.Name $temp.GroupDescription = $Workspace.Description $temp.GroupType = $Workspace.Type $temp.GroupState = $Workspace.State $temp.GroupIsReadOnly = $Workspace.IsReadOnly $temp.GroupIsOrphaned = $Workspace.IsOrphaned $temp.GroupIsOnDedicatedCapacity = $Workspace.IsOnDedicatedCapacity $temp.GroupCapacityId = $Workspace.CapacityId IF($Workspace.users.AccessRight.count -eq 1) { $temp.GroupAccessRight = $Workspace.users.AccessRight $temp.GroupUserPrincipalName = $Workspace.users.UserPrincipalName } Elseif ($GroupDatasets.users -eq $null){ $temp.GroupAccessRight = 'NotFound' $temp.GroupUserPrincipalName = 'NotFound' } Else { $temp.GroupAccessRight = $Workspace.users.AccessRight[$i2] $temp.GroupUserPrincipalName = $Workspace.users.UserPrincipalName[$i2] } $temp.Datasetid = $Datasets.id $temp.Datasetname = $Datasets.name $temp.DatasetaddRowsAPIEnabled = $Datasets.addRowsAPIEnable $temp.DatasetconfiguredBy = $Datasets.configuredBy $temp.DatasetisRefreshable = $Datasets.isRefreshable $temp.DatasetisEffectiveIdentityRequired = $Datasets.isEffectiveIdentityRequired $temp.DatasetisEffectiveIdentityRolesRequired = $Datasets.isEffectiveIdentityRolesRequired $temp.DatasetisOnPremGatewayRequired = $Datasets.OnPremGatewayRequired IF ($SourceCount -eq 0) { $temp.SourceName = 'NotFound' $temp.SourceConnectionString = 'NotFound' $temp.SourceDatasourceType = 'NotFound' $temp.SourceConnectionDetails = 'NotFound' $temp.SourceGatewayId = 'NotFound' $temp.SourceDatasourceId = 'NotFound' } Else{ $temp.SourceName = $Source[$i].name $temp.SourceConnectionString = $Source[$i].ConnectionString $temp.SourceDatasourceType = $Source[$i].DatasourceType $temp.SourceConnectionDetails = $Source[$i].ConnectionDetails $temp.SourceGatewayId = $Source[$i].GatewayId $temp.SourceDatasourceId = $Source[$i].DatasourceId } $GroupDatasetSource.Add($temp) | Out-Null $CountRows++ "RowsNbr :" + $CountRows $i2++ } While ($i2 -le $Workspace.users.AccessRight.count-1) $i++ } While ($i -le $SourceCount-1) } } } "Total datarows: "+ $CountRows "Export to CSV: " + $CSV $GroupDatasetSource | Export-Csv $CSV "All done" Muita hyödyllisiä linkkejä: Power BI Management module in the PowerShell Gallery https://www.powershellgallery.com/packages/MicrosoftPowerBIMgmt Power BI cmdlets documentation https://docs.microsoft.com/en-us/powershell/power-bi/overview?view=powerbi-ps Open Source repository for Power BI cmdlets on GitHub https://github.com/Microsoft/powerbi-powershell Power BI SDK for .NET https://github.com/Microsoft/PowerBI-CSharp Power BI REST API Reference https://docs.microsoft.com/en-us/rest/api/power-bi/ Quick reference for PowerShell cmdlets, REST APIs, and SDK for Power BI administration https://docs.microsoft.com/en-us/power-bi/service-admin-reference Power BI Community site https://community.powerbi.com/Lisää ajankohtaisia julkaisuja:
Onko tekoälyn hyödyntämisestä vielä(kään) konkreettista hyötyä kilpailukyvylle?
Jo vuosia on puhuttu, että tekoälyn (AI) hyödyntäminen mullistaisi teollisen tuotannon ja palvelut lisäämällä tehokkuutta ja tuottavuutta. Missä ne konkreettiset hyödyntämismahdollisuudet sitten oikein piilevät?
The effect of preconceptions on the results of machine learning
The use of machine learning and artificial intelligence offers many possibilities, such as the improvement of medical treatment and diagnosis, identifying potential safety hazards, and advancing scientific research. However, when used inappropriately, data models can also perpetuate inequality or cause people and companies to focus on improving metrics to the detriment of actual performance.
Organisaation hierarkian hallintaratkaisu Microsoft Power Platformia hyödyntäen
Yleinen tilanne varsinkin suuremmissa yrityksissä on se, että olemassa olevat ERP-, henkilöstö- taikka taloushallinnon ohjelmistot tarjoavat mahdollisuuksia hierarkioiden luomiseen ja ylläpitämiseen. Mutta entä jos valmiit ratkaisut eivät tue yrityksen tarvetta, taikka toimivat turhan kankeasti käyttötarkoitukseen?
Lisää ajankohtaisia julkaisuja:
Onko tekoälyn hyödyntämisestä vielä(kään) konkreettista hyötyä kilpailukyvylle?
Jo vuosia on puhuttu, että tekoälyn (AI) hyödyntäminen mullistaisi teollisen tuotannon ja palvelut lisäämällä tehokkuutta ja tuottavuutta. Missä ne konkreettiset hyödyntämismahdollisuudet sitten oikein piilevät?
The effect of preconceptions on the results of machine learning
The use of machine learning and artificial intelligence offers many possibilities, such as the improvement of medical treatment and diagnosis, identifying potential safety hazards, and advancing scientific research. However, when used inappropriately, data models can also perpetuate inequality or cause people and companies to focus on improving metrics to the detriment of actual performance.
Organisaation hierarkian hallintaratkaisu Microsoft Power Platformia hyödyntäen
Yleinen tilanne varsinkin suuremmissa yrityksissä on se, että olemassa olevat ERP-, henkilöstö- taikka taloushallinnon ohjelmistot tarjoavat mahdollisuuksia hierarkioiden luomiseen ja ylläpitämiseen. Mutta entä jos valmiit ratkaisut eivät tue yrityksen tarvetta, taikka toimivat turhan kankeasti käyttötarkoitukseen?