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.).
Hi Lumpie,
You can use this API to run a DAX query like "Evaluate Values(TableName[ColumnName])".
This will result in the distinct list of values from TableName[ColumnName], including a possible blank row due to broken referential integrity.
It is the same logic used by Power BI itself to populate slicers.
Note that if your tabular model is hosted on AAS/SSAS, you cannot use this API.
In this case, you can use the AMO-TOM assemblies to send the DAX query.
Those assemblies can be used to connect to any tabular model through its XMLA endpoint.
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
- xhan4 years agoHelper I
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 agoCommunity 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 agoHelper 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!