知识库

创建包含多个度量的 100% 堆叠条形图


发布时间: 26 Feb 2020
上次修改日期: 20 Oct 2022

问题

如何在行或列功能区上创建具有度量值的 100% 堆叠条形图。

用户添加的图像

环境

  • Tableau Desktop 

答案

步骤 1
在附带的示例工作簿“StackedBarExample.twbx”中,创建三个计算字段,如下所示。

计算字段 1
[Sales1(%)]
SUM([Sales1])/(SUM([Sales1])+SUM([Sales2])+SUM([Sales3]))

计算字段 2
[Sales2(%)]
SUM([Sales1])/(SUM([Sales1])+SUM([Sales2])+SUM([Sales3]))

计算字段 3
[Sales3(%)]
SUM([Sales3])/(SUM([Sales1])+SUM([Sales2])+SUM([Sales3]))

步骤 2
将度量值卡中的“[Sales1]”、“[Sales2]”、“[Sales3]”替换为“[Sales1%]”、“[Sales2%]”、“[Sales3%]”。
 
此文章是否已解决问题?