
知乎、微博热搜榜,B站后台统计榜的共性是使用了中文图标,Power BI可以表格矩阵可以使用SVG图标实现相同效果。

上图文字图标使用了圆角正方形造型,边框、填充色、文字是相同颜色,只是填充色透明度低一些。Power BI新建度量值:
SVG.中文图标 =
SWITCH (
[M.排名.销售业绩],
1,
"data:image/svg+xml;utf8,<svg class='wujunmin' width='48' height='48' xmlns='http://www.w3.org/2000/svg'>
<rect rx='6' x='1' y='1' width='46' height='46' fill='Red' fill-opacity='0.2' stroke-width='2' stroke='Red'/>
<text x='24' y='36' font-size='32' text-anchor='middle' fill='Red'>高</text>
</svg>",
5,
"data:image/svg+xml;utf8,<svg class='wujunmin' width='48' height='48' xmlns='http://www.w3.org/2000/svg'>
<rect rx='6' x='1' y='1' width='46' height='46' fill='Blue' fill-opacity='0.2' stroke-width='2' stroke='Blue'/>
<text x='24' y='36' font-size='32' text-anchor='middle' fill='Blue'>低</text>
</svg>"
)度量值放入表格单元格元素即完工。图标切换逻辑按需修改。
