Forum Discussion
Two questions on embedded dataselected events
Eric_ZhangMade another report that is similar, except that it is "Direct Query" on an Azure database, while the other one was "Imported" from an on-premises database (the Azure is actually a copy of the on premises one).
On this new report, the dataselected event is fired on every type of visual.
And also the "filters" part gives (almost) what I'm looking for, which is, since you ask, the visual level filters that the user has selected from the filters sidebar.
In JSON sample below, that is the filter WHERE customer_desc IN (..., ....) AND revenue > 10
The revenue column is not mentioned in the JSON but I assume that is because is implicit because it the metric of that visual (which is provided else where in the visua
"filters": [
{
"$schema": "http://powerbi.com/product/schema#basic",
"target": {
"table": "vw_kpi_all_sales",
"column": "customer_desc"
},
"operator": "In",
"values": [
"Wa****rt",
"De****ze"
]
},
{
"$schema": "http://powerbi.com/product/schema#advanced",
"logicalOperator": "And",
"conditions": [
{
"operator": "GreaterThan",
"value": 10
}
]
}
]
Explanation of the business problem I'm trying to solve
- The PBI reports shows KPI of data warehouse about plans and predicted future events.
- That data warehouse cube is produced by an application from raw SQL DB numbers, which are produced by the application and its users.
- The PBI report is embedded in that application
- The user looks at the report and sees for example a slice of pie that doesn't look right.
- The user clicks on that slice
- The application captures that event and then tries to figure out from the combined report, page and visual filters; as well as the selted "identities" of that slice and deduct which "slice & dice" that represents in the data warehouse cube; and which tables & joins that corresponds to in SQL, which WHERE clause applies.
- Then it brings up UI from application where user can see and edit the raw data that make up the "slice of the pie" so the user can set the wrongs right.
- The ability to edit is the crux of the biscuit here: drilling down to only see the details could be done in PBI itself - no need for embedding.
Problems encountered
- Solved: The selection events & visual filters didn't come out well, this has been solved by re-creating the report.
- Unsolved: The page & report filters don't come out (see screenshot below). There is a page filter active (date in the last year) but I'm not capable to extract it in code. The getFilters() methods don't tell about it.