GitHub user dosubot[bot] added a comment to the discussion: render as html format
<!-- Answer --> Unfortunately, maintaining a separate "clean" metric alongside an HTML metric in a Pivot Table isn't practical — you'd end up with both metrics displayed as separate columns/rows in the pivot, and there's no built-in way to selectively hide one during export while showing the other on screen. **Better approach: Use Pivot Table's native Conditional Formatting instead.** The Pivot Table V2 has built-in conditional formatting support [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx) that applies cell background colors based on metric values — no HTML needed. To use it: 1. Replace your HTML-wrapped custom SQL metric with a plain metric (just the raw value, no `<span>` tags) 2. In the chart's **Customize** tab, look for the **Conditional Formatting** section 3. Add color rules based on value thresholds (e.g., red if value < X, green if value > Y) This approach keeps your data clean, so exports will contain only the numeric/text values without any HTML markup. **Caveat:** The Pivot Table's conditional formatting is more limited than the regular Table chart — it supports threshold-based background colors but lacks some options like "green for increase, red for decrease" [[2]](https://github.com/apache/superset/pull/37362). If your coloring logic is more complex than simple thresholds, this may not fully cover your use case. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=9f2ad85a-49d6-4635-8756-a08d89a5f0f7) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) GitHub link: https://github.com/apache/superset/discussions/40044#discussioncomment-16887535 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
