A switch-style slicer for any two-value field: Yes/No, With/Without, Active/Inactive, Light/Dark. Português abaixo.
⬇ Download ToggleSwitchSlicer.pbiviz (latest) · sample report (.pbix) · sample as Power BI project (.pbip) · all releases
In Power BI: Visualizations › … › Import a visual from a file. Some organizations only allow visuals from AppSource or approved by the Power BI admin; if the import is blocked, ask your admin.
- Download the
.pbiviz(above) and use Import a visual from a file. - Drag a field with two values to Field (2 values).
- In the Format pane › Values, set the value applied when the switch is on (default: the 2nd value of the field) and when it is off (default: no filter).
- Optional: label (defaults to the field name), icon, colors per state, border and corner radius.
- To keep the same state on every page: View › Sync slicers.
- Light/Dark theme: create a two-value table (Light, Dark) and measures that return colors with
IF(SELECTEDVALUE(Theme[Theme]) = "Dark", "#14181D", "#F3F4F6"); use them in conditional formatting. - With/Without: a two-value table and a measure such as
[Sales] + IF(SELECTEDVALUE(Taxes[Taxes]) = "With tax", [Tax]).
Open an issue describing the problem, the Power BI version (Desktop or Service) and, if possible,
a sample .pbix without confidential data.
The visual does not collect or send any data. See PRIVACY.md.
The source is in visual/ (TypeScript, built with powerbi-visuals-tools; see visual/README.md).
Released under the MIT License: free to use, modify and share, with no warranty.
Contributions and suggestions are welcome via issues and pull requests.
Segmentação em forma de chave para qualquer campo de dois valores: Sim/Não, Com/Sem, Ativo/Inativo, Claro/Escuro.
- Baixe o ToggleSwitchSlicer.pbiviz e importe em Visualizações › … › Importar um visual de um arquivo.
- Arraste um campo de dois valores para Campo (2 valores).
- Em Formatar › Valores, defina o valor aplicado com a chave ligada (padrão: 2º valor do campo) e desligada (padrão: sem filtro).
- Opcional: rótulo (padrão: nome do campo), ícone, cores por estado, borda e raio.
- Para manter o estado em todas as páginas: Exibição › Sincronizar segmentações.
Abra uma issue com o problema, a versão do Power BI (Desktop ou serviço) e, se possível, um .pbix
de exemplo sem dados confidenciais.
O visual não coleta nem envia dados. Veja PRIVACY.md.
O código está em visual/. Licença MIT: uso, alteração e distribuição livres, sem garantia.
