Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Choropleth warning text appears when switching between measures using the SWITCH() function #74

Open
pellenbe opened this issue Jul 18, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@pellenbe
Copy link

Describe the bug
Choropleth warning text appears the first time when using a slicer to switch between different measures contained within a single measure with a SWITCH() function. The text reads "Add only Location & Color fields to use a choropleth layer. Location attribute must match US State, Global Country, or US Postal Code. The default setting is US States and can be changed in the "Data Level" property within Choropleth settings. For other polygons, use a custom tileset." The text only displays the first time the measure is changed - it does not display when the map is initially loaded or when making a second (or beyond) selection.

To Reproduce
Steps to reproduce the behavior:

  1. Create a single measure that uses the SWITCH() function to switch between several different measures
  2. Use the measure with the SWITCH() function as to populate the "Color" field of a Choropleth map
  3. Using a slicer, switch from the default selected value for the SWITCH() measure to another value (i.e., change the selected measure such that the colors on the Choropleth map will update to correspond with the newly selected measure)
  4. While the map is loading the newly selected measure, the text will display briefly.

Expected behavior
The text should not display when the Color field is populated, even if there is lag time associated with the selected measure loading in Power BI. Ideally, it should not display at all in a published version of a Power BI report.

Screenshots
image

Additional context
In addition to ensuring all our DAX is optimized, I also forked this repo and made the following changes:
1.Deleting the text altogether from templates.ts (note, the text contained here is slightly different than what's actually showing - it does not include the word "other")
2. Commenting out the check in visual.ts that seems to be responsible for the text appearing when either the Location or Color fields are not populated
3. Changing the color of the text from black to white in visual.less

After each change, I recompiled the .pbiviz using the pbiviz CLI tool and imported the new custom visual to PBI, but the issue persisted. Given that the text contained in templates.ts is slightly different from what is displaying on screen, and that the changes above didn't resolve the issue, my suspicion is that the text is coming from elsewhere.

@pellenbe pellenbe added the bug Something isn't working label Jul 18, 2023
@mate-turi mate-turi assigned budavariam and unassigned mate-turi Oct 19, 2023
@LaurentBarriere
Copy link

LaurentBarriere commented Feb 16, 2024

what is the version of your plugin in Power BI? (check the about)
Always use the up to date version from Github to ensure you are up to date with the updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants