Forum Discussion
Setting up a default view with a filter in a published report
Dear Community,
I am a novice user of PowerBI and looking forward to your help which hopefully is a simple problem to many of you. Below is the link to the published dashboard. In this dashboard, I have two visuals primarily passing interaction through a map to the combo chart. When I published the view to the server , the interaction that I setup with filter trhough map in the combo chart does not reflect. It shows averaged value to the entire region for bar which is not the appropriate display and may convey incorrect message to the user. However once the user start interacting with the map, it will be correct. So my concern is primarily when the user deselect the selection in the map, the bar will reflect aggregated averaged value. So I am looking for a way to have a default filter for bar set to Addis Adaba when no interaction is passed from map to bar or when the user clear the selection in the map. Is this possible to execulte. PBIX FILE
2 Replies
- freginier
Solution Sage
Hi nprasai,
The behavior you describe is by design. Cross-highlighting only fires while a map item is actually selected - the moment the user clears the map selection (or first opens the report), the bar visual reverts to the unfiltered total, which is why you see an averaged value across all regions.
To pin a default of "Addis Ababa" when no map selection is active, build the filter into a measure rather than relying on cross-highlight:
Bar Value =
VAR DefaultCity = "Addis Ababa"
VAR HasUserSelection =
ISFILTERED('Cities'[City])
&& COUNTROWS(VALUES('Cities'[City])) < COUNTROWS(ALL('Cities'[City]))
RETURN
IF(
HasUserSelection,
SUM(Facts[Amount]),
CALCULATE(SUM(Facts[Amount]), 'Cities'[City] = DefaultCity)
)
Use [Bar Value] on the bar chart instead of a raw SUM.
- When no city is clicked (or all cities cleared), the IF branch falls into the CALCULATE that pins Addis Ababa.
- When the user clicks a single city on the map, ISFILTERED is true and COUNTROWS(VALUES) < COUNTROWS(ALL), so SUM(Facts[Amount]) takes over - cross-highlight resumes naturally.
Two nice-to-haves:
1) Disable the implicit cross-filter from the map to the bar so the visual doesn't get "averaged out" when no selection is active. Format > Edit interactions > select the map > set the bar chart to None (filter off). The measure does all the work.
2) If your business rule is "default to capital city of the selected country", parameterize DefaultCity:
VAR DefaultCity = SELECTEDVALUE('Country'[CapitalCity], "Addis Ababa")
so a country slicer can drive the default per country.
Alternatives worth knowing:
- A Bookmark with "Selected visuals" + Data captured can pre-load Addis Ababa as a starting state, but it doesn't survive the user clearing filters.
- A persistent filter pinned on the page (Filters pane > set City = Addis Ababa, hide it) gives a default value, but then the map cross-filter can't override it.
The measure pattern is the cleanest because it gives both: a default AND respects user interaction.
- julsr
Continued Contributor
Hi nprasai ,
What you shared is expected for selection-driven interaction: the map only narrows filter context for other visuals while a selection is in place. On first load or after the user clears the map, that narrow context goes away, so the combo chart goes back to the page-level numbers. That is why the bar can look “wrong” until interaction starts—it is not a publish bug; it is how cross-filter / cross-highlight behaves when no data point is selected. You can change how strongly visuals affect each other under Edit interactions; see Microsoft’s guidance on how visuals cross-filter and cross-highlight and changing visual interactions.
Recommendation: Put the “default to Addis Ababa when nothing is selected” rule in a measure used by the combo chart (instead of relying on the map alone for that default). When the user has focus on a single city from the map, use the normal aggregation; when there is no such narrow selection, CALCULATE for your default city. A pattern like the one freginier shared in this thread works well: detect “user has effectively picked one city” with something like ISFILTERED plus a comparison of VALUES vs ALL on the city column (adjust table/column names to your model).
Hope this answer helps.
Best,