Forum Discussion
Hierarchy Slicer Metadata for Auto Date/Time Hierarchies in Power BI Embedded
- Anonymous3 months ago
Hi Shubhangi18 ,
Thank you for your follow up.
To clarify, when referring to a dedicated Date table and custom hierarchies, you would retain your existing columns Column A, Column B, and Column C as they are, without removing or migrating any data. There is no risk of data loss.
The main issue is that Auto Date Time generates hidden date tables and hierarchies, which are exposed in the Embedded API only as Date Hierarchy, without linking back to the original columns. Since these LocalDateTables are not accessible via the API, it is not currently possible to determine whether a selection originated from Column A, Column B, or Column C.
The recommended approach is to modify the report's model by creating custom hierarchies with distinct names and using those in the slicer. For example, you could define separate hierarchies for Order Date, Ship Date, and Invoice Date. These custom hierarchies are identifiable through the API, enabling you to pinpoint the source context.If your report currently uses Auto Date Time hierarchies, there is no supported API method to map a hierarchy slicer back to its underlying date column. In this case, updating the report to use custom date hierarchies is the only reliable solution to avoid ambiguity.
In summary, the recommendation is to keep your existing date columns and replace the Auto Date Time hierarchy objects with custom hierarchies that can be uniquely identified through the API.
Thank you.
Hello ,
No, there is currently no supported API. You should resolve the ambiguity at the data-modeling layer. If you use role-playing dimensions (physical tables like OrderDateCalendar and ShipDateCalendar), getSlicerState() will return uniquely identifiable targets. You can address like
"table": "OrderDateCalendar", "hierarchy": "Calendar Hierarchy", "hierarchyLevel": "Year"
Please check role playing dimensions.
If this solved your issue, please mark it as the accepted solution. ✅