我相信你最好的选择是一个简单的条形图。在我看来,这里的关键是让条形图的值由收集到的目标的百分比来表示。但是,您希望每个条形图的标签是迄今为止收集的实际金额。这样,当接近目标时,您的栏会按比例增长,但标签会显示收集的数量。
或者,您可以创建一个包含已完成百分比的表格作为数据栏,并显示迄今为止收集的数量与目标。
包括样本的屏幕截图。请注意以下事项:
我对查询中的颜色名称进行了硬编码。这是控制图表外观和感觉的好方法。然后您只需更改颜色以表示等于颜色字段值的表达式。对于不同的浅色和深色,您还可以设置字体颜色,因此如果您有一个浅蓝色条,您可以使用黑色文本而不是白色,反之亦然。
在条形图上使用标签时,您需要为条形图编写一个最低限度的值。这将确保当您拥有像 Bucket 5 这样的东西时,您处于目标的 5%(一个相对较小的条形图)但金额很大(124,243 美元)时,条形图将调整为足够大以包含标签。在这种情况下,如果收集的百分比小于 15%,则条形大小将为 15%。
如果您有任何问题,请发表评论,我会尽力提供帮助。我用来生成数据集的查询如下。
With CTE as (
Select 'Bucket 1' as bucket, 'blue' as color, 'white' as text_color, 50 as percent_total, 15236 as amount Union all
Select 'Bucket 2' as bucket, 'red' as color, 'white' as text_color, 33 as percent_total, 24685 as amount Union all
Select 'Bucket 3' as bucket, 'green' as color, 'black' as text_color, 67 as percent_total, 41457 as amount Union all
Select 'Bucket 4' as bucket, 'purple' as color, 'white' as text_color, 95 as percent_total, 32493 as amount Union all
Select 'Bucket 5' as bucket, 'black' as color, 'white' as text_color, 5 as percent_total, 124243 as amount
)
Select CTE.*
, CAST(amount as float) / (CAST(percent_total as float) / 100.00) as Goal
From CTE
Order by Bucket desc
根据评论编辑
如果您希望所有桶和剩余部分都在一个条上,那么您可以通过以下方式完成此操作(尽管我不确定您将如何处理将金额标记到各个桶)。
最终结果
查询
Declare @Goal int = 500000;
With CTE as (
Select 'Bucket 5' as bucket, 'blue' as color, 'white' as text_color, 15236 as amount Union all
Select 'Bucket 4' as bucket, 'red' as color, 'white' as text_color, 24685 as amount Union all
Select 'Bucket 2' as bucket, 'green' as color, 'black' as text_color, 41457 as amount Union all
Select 'Bucket 3' as bucket, 'purple' as color, 'white' as text_color, 32493 as amount Union all
Select 'Bucket 1' as bucket, 'black' as color, 'white' as text_color, 124243 as amount
)
Select CTE.bucket
, CTE.color
, CTE.text_color
, CTE.amount
, CAST(CTE.amount as float) / CAST(@Goal as float) as percent_total
, 'white' as border_color
From CTE
Union All
Select 'Remaining' as bucket
, 'Transparent' as color
, 'Transparent' as text_color
, @Goal - SUM(CTE.amount) as amount
, CAST(@Goal - SUM(CTE.amount) as float) / CAST(@Goal as float) as percent_total
, 'black' as border_color
From CTE
Order by Bucket
报表生成器中的设置
请注意,我已将边框颜色动态更改为:
=Fields!border_color.value
条的颜色为:
=Fields!color.value