Forum Discussion
Is there an API to get possible filter values (for buiding custom filter UI)?
- 4 years ago
Hi Lumpie,
AMO-TOM gives you full access to the tabular object model, including the table names, column names & data types.
Alternatively, you can use AMO-TOM to query DMVs (e.g. select * from $SYSTEM.TMSCHEMA_TABLES).
In the Power BI APIs front, you can use the scanner APIs.
However, those are probably not suited for your use case (asynchronous, the metadata may not be up to date etc.).
That looks promising! I'll have a look at this.
Is there a way to get the available tables and/or columns this way as well? Or do you need to 'know' these beforehand?
Thanks for the help!
Mark
Lumpie were you able to figure out how to get the avaiable tables and columns?
SpartaBI can we get in a visual within a report, what are the tables and columns used in some rest APIs?
Thanks a lot!
- SpartaBI4 years ago
Community Champion
Hi xhan,
You can get the available tables & columns using the AMO-TOM assemblies
Look at my reply from 06-23-2022 06:38 PM.
Using the Power BI embedded SDK, you can get the tables & columns defined in a visual. See here.- xhan4 years ago
Helper I
Thank you SpartaBI for the quick reply! I'm pretty new to power BI, and have some general questions.
1. Is AMO-TMO based on sql-server? we are not really using sql-server.
2.The embedded SKD looks like based on JS, I'm curious if there are something similar in the rest APIs?
3. I guess my previous question was not very clear. I'd like to pull all the metadata of the dashboards and reports. In a report, I'd like to know what are the pages, in each page what are the visuals, and what data source table and columns are used in the visuals etc. I was following this https://docs.microsoft.com/en-us/power-bi/admin/service-admin-metadata-scanning-setup to call the admin scanner APIs, but I don't see any table/column/measure data at all.
Thanks a lot!
Thanks a lot!
- SpartaBI4 years ago
Community Champion
Hi xhan,
1. Power BI uses "Analysis Services" as its analytical engine. AMO-TOM enables you to connect to an Analysis Services instance using its XMLA endpoint. If you are using Power BI Premium, you can allow access to the XMLA endpoint and use AMO-TOM. Analysis Services is also included as part of SQL Server (SSAS = SQL Server Analysis Services), but that should not concern you.
2. This functionality is not exposed as part of the documented Power BI REST APIs.
3. AFAIK, the scanner APIs do not return metadata at the page or visual granularity. If you set both tenant settings in the doc & performed a refresh, You should be able to get table/column/measure. See this doc regarding limitations.
This is an area in which Power BI lacks functionality. There are APIs to get some details for the pages & dashboards. See
get-pages-in-group
get-dashboards-in-group
get-tiles-in-group
You also have the option to get the structure directly from PBIX files by using 3-party (unsupported) tools like PBI Tools
Those parse the pages & visuals metadata. See, for example here (19:00).
If you need to export reports to PBIX files you can use
export-report-in-group