Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello, I have a script where I see all the datasets from all the workspaces in my organization but I have 2 conditions to add in it that is where I get stuck.
If I need to get the list of datasets from all the workspaces with the condition of dataset being updated/modified (not refereshed but updated or modified) in last 7 days and using the dataset source to check if it has its own dataset (not pointing/referring to other dataset). How can I achieve this?
So far this is the script I got which only gives me list of all datasets from all the workspaces.
Connect-PowerBIServiceAccount
$Workspace = Get-PowerBIWorkspace –All
$DataSets = ForEach ($workspace in $Workspace) {
Write-Host $workspace.Name ForEach ($dataset in (Get-PowerBIDataset -WorkspaceId
$workspace.Id)){
[pscustomobject]@{
WorkspaceName = $Workspace.Name
WorkspaceID = $workspace.Id
DatasetName = $dataset.Name
DatasetID = $dataset.Id
}
}
}
$Dir = "C:\myShare\pbi\MyWorkspace.csv" $DataSets | Export-Csv $Dir -NoTypeInformation -Encoding UTF8
Disconnect-PowerBIServiceAccount
Can someone please guide me.
Thanks in advance.
Hi, @Akshay1994 ;
Refer to the following posts to set up filters. Or try to get the refresh time of the data set and filter within 7 days.
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/get-refresh-history
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.