Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Q1: On a report, the data selected event is fired for some type of visuals but not on others.
Visuals fired: pies, (stacked) column charts.
Not fired: maps, doughnuts, bar charts.
Any ideas what may cause that? I am using the latest powerbi.js from github.
Q2: The "filter" part of the fired event details is not helpful.
See "filters" at the end of the JSON below. Itdoes not give clues to which columns/tables are filtered on.
I happen to know that the filter is "WHERE Year = IN (2016, 2017) and [sales].revenue > $10".
But how can the code figure that out?
{ "report": { "id": "****-****-****-****-****", "displayName": "test report" }, "page": { "name": "ReportSection", "displayName": "Sales 12 months rolling" }, "visual": { "name": null, "title": "revenue by Month and Year", "type": "clusteredColumnChart" }, "dataPoints": [ { "identity": [ { "target": { "table": "LocalDateTable_****-****-****-****-****", "column": "Month" }, "equals": "March" }, { "target": { "table": "LocalDateTable_****-****-****-****-****", "column": "Year" }, "equals": 2017 } ], "values": [ { "target": { "table": "vw_kpi_all_sales", "column": "revenue", "aggregationFunction": "Sum" }, "value": *****, "formattedValue": "*****" } ] } ], "regions": null, "filters": [ { "$schema": "http://powerbi.com/product/schema#basic", "target": null, "operator": "In", "values": [ 2017, 2016 ] }, { "$schema": "http://powerbi.com/product/schema#advanced", "logicalOperator": "And", "conditions": [ { "operator": "GreaterThan", "value": 10 } ] } ] }
@jvdl wrote:
Q1: On a report, the data selected event is fired for some type of visuals but not on others.
Visuals fired: pies, (stacked) column charts.
Not fired: maps, doughnuts, bar charts.
Any ideas what may cause that? I am using the latest powerbi.js from github.
Q2: The "filter" part of the fired event details is not helpful.
See "filters" at the end of the JSON below. Itdoes not give clues to which columns/tables are filtered on.
I happen to know that the filter is "WHERE Year = IN (2016, 2017) and [sales].revenue > $10".
Q1: On a report, the data selected event is fired for some type of visuals but not on others.
Based on my test, the dataselected event doesn't fire for the map, but for bar, doughnuts visuals. This event will be triggered by selections on the visuals those you can "select", I mean "select" reflection as below snapshot.
Q2: The "filter" part of the fired event details is not helpful.
In my test, I observed that the visual level filter is contained in the dataselected event JSON, while page/report level filters are not. If your issue refer to report level filter, you could try console.log(report.getFilters());
@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
Problems encountered
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
23 | |
3 | |
2 | |
2 | |
2 |