[英]How to implement tool-tip on Stacked bar chart in Power BI
I have a Stacked bar chart that displays Tasks by UserName. 我有一个堆积的条形图,按用户名显示“任务”。 So each user can have: Closed Tasks - black color Overdue Tasks - red color Open Tasks - green color
因此,每个用户都可以拥有:关闭的任务-黑色过期的任务-红色开启的任务-绿色
How can I use a tool-tip so when I drag my mouse on any of tasks I want to see how many of those task are particular type. 如何使用工具提示,以便在将鼠标拖到任何任务上时想查看其中有多少是特定类型的任务。
For example, if I am interested in user Alison Petrarca, if I point my mouse on a green color (where value is 24) I want to see that there is 8 of them are "Audits" type; 例如,如果我对用户Alison Petrarca感兴趣,如果我将鼠标指向绿色(值是24),我希望看到其中有8种是“审核”类型; 9 of them are "Follow-up" type;
其中9个是“跟进”类型; 6 of them are "Pending Cancellation" type etc.
其中6种为“待取消”类型等。
Same if I point my mouse on a red color (where value is 6) I want to see what types of tasks contain those 6. 如果将鼠标指向红色(值为6),我也想查看哪些类型的任务包含这些6。
Is it possible to achieve that? 有可能实现这一目标吗?
So far I created a couple of measures for Audit type for Open and Overdue tasks: 到目前为止,我为“未完成”和“过期”任务的“审核类型”创建了两个度量:
AuditsOpen = CALCULATE(SUM(TotalCounts[OpenTasks]), TotalCounts[Type]= "Audits")
AuditsOpen = CALCULATE(SUM(TotalCounts[OpenTasks]), TotalCounts[Type]= "Audits")
But then, even if I point mouse only on green (Open Tasks) I still see Audits for open tasks and audits for Closed tasks. 但是,即使我仅将鼠标指向绿色(“打开的任务”),我仍然会看到“打开的任务的审核”和“关闭的任务”的审核。 But I only want to see for open tasks.
但我只想查看未完成的任务。
Reshaping your data will make this fairly simple. 重塑数据将使这一过程变得相当简单。 Take your
TotalCounts
table and unpivot the ClosedTasks
, OverdueTasks
, and OpenTasks
columns in the query editor so that it looks like this: 把你的
TotalCounts
表和UNPIVOT的ClosedTasks
, OverdueTasks
和OpenTasks
在查询编辑器列,以便它看起来像这样:
AssignedTo | Type | Status | Tasks
-----------------|--------|--------------|-------
Allison Petrarca | Audits | ClosedTasks | 6
Allison Petrarca | Audits | OverdueTasks | 3
Allison Petrarca | Audits | OpenTasks | 8
Allison Petrarca | Claims | ClosedTasks | 4
Allison Petrarca | Claims | OverdueTasks | 0
Allison Petrarca | Claims | OpenTasks | 0
... (etc.) ...
Then you can put AssignedTo
on your Axis, Status
as your Legend, and Tasks
as your Value. 然后,您可以将
AssignedTo
放在Axis上,将Status
用作图例,将Tasks
用作值。 Then you'll create a measure for each Type
you want on the tooltip. 然后,您将在工具提示上为每种
Type
创建一个度量。 Ie 即
Audits = CALCULATE(SUM(TotalCounts[Tasks]), TotalCounts[Type]="Audits")
Claims = CALCULATE(SUM(TotalCounts[Tasks]), TotalCounts[Type]="Claim")
... (etc.) ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.