Forum Discussion
How to Query Report folder structure of PowerBI report server and see all the hierarchy of folders ?
- 4 years ago
You can also do this in a Power BI Report using an OData connector and connecting to the following endpoint
http(s)://<yourserver>/reports/api/v2.0/CatalogItems
This has a report path column which you can split on / characters to create a hierarchy
You could try starting with something like this SQL and modify it from here. You'll need access to the SQL Server and the ReportServer database.
USE [ReportServer]
GO
SELECT CATALOG.NAME
,CATALOG.[Path]
,DataSource.NAME datasource
,CATALOG.[Description]
,Created.UserName AS CreatedByUser
,CATALOG.[CreationDate]
,Modified.UserName AS ModifiedByUser
,CATALOG.[ModifiedDate]
FROM [dbo].[Catalog]
LEFT JOIN (
SELECT [UserID]
,[UserName]
FROM [dbo].[Users]
) AS Created ON CATALOG.CreatedByID = Created.UserID
LEFT JOIN (
SELECT [UserID]
,[UserName]
FROM [dbo].[Users]
) AS Modified ON CATALOG.ModifiedByID = Modified.UserID
JOIN DataSource ON CATALOG.ItemID = DataSource.ItemID
JOIN CATALOG cat1 ON DataSource.Link = cat1.ItemID
WHERE CATALOG.[Type] = 2
ORDER BY [Path]
,NAME