You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Power BI Deneb瀑布图使用x2规则时X轴排序异常问题

Vega-Lite瀑布图迁移至Power BI Deneb后的X轴排序异常问题
  • 在Vega Editor中用Vega-Lite制作的瀑布图,仅最后一条规则超出图表区域,其余显示正常。
  • 将代码迁移至Power BI Deneb时,仅替换数据集为动态(数据内容与原数据完全一致),却出现X轴前两个值排序混乱的问题。
  • 经排查,问题与x2编码直接相关:注释掉x2编码后,排序恢复正常,目前无法确定问题源于代码本身还是Power BI Deneb的设置。

相关代码片段:

"mark": {
        "type": "rule",
        "color": "#000000dc",
        "opacity": 1,
        "strokeWidth": 3,
        "xOffset": {"expr": "-(clamp((width / datum.count) / 2, 10, 25))"},
        "x2Offset": {"expr": "clamp((width / datum.count) / 2, 10, 25)"}
      },
      "encoding": {
        "x": {
          "field": "risco",
          "type": "nominal",
          "sort": {"field": "sortkey", "order": "ascending"},
          "axis": {"title": null}
        },
        "x2": {
          "field": "lead",
          "type": "nominal",
          "sort": {"field": "sortkey", "order": "ascending"}
        },
        "y": {"field": "cumulative", "type": "quantitative"}
      }

Vega Editor效果:
Vega Editor效果

Power BI Deneb效果:
Power BI Deneb效果

内容的提问来源于stack exchange,提问作者Talles Lessa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 01:17:06