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.
- Lumpie4 years agoFrequent Visitor
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.