[英]How can I filter multiple columns that include the same value in Power BI?
I currently have a table in Power BI named Jira Tickets
.我目前在 Power BI 中有一个名为
Jira Tickets
的表。
Here is sample data from Jira Tickets
:以下是来自
Jira Tickets
的示例数据:
Issue id![]() |
Label ![]() |
Label 1 ![]() |
Label 2 ![]() |
Label 3 ![]() |
Label 4 ![]() |
---|---|---|---|---|---|
1000 ![]() |
Apples![]() |
Grapes![]() |
Bananas![]() |
Oranges![]() |
Strawberries![]() |
1001 ![]() |
Oranges![]() |
Pears![]() |
Apples![]() |
Bananas![]() |
Strawberries![]() |
1002 ![]() |
Pears![]() |
Dragon Fruit![]() |
Apples![]() |
Strawberries![]() |
Dragon Fruit![]() |
1003 ![]() |
Bananas![]() |
Oranges![]() |
Apples![]() |
Grapes![]() |
Pears![]() |
1004 ![]() |
Grapes![]() |
Apples![]() |
Bananas![]() |
Pears![]() |
Strawberries![]() |
I want to create a slicer in Power Bi to filter by the column values in Label
Label 1
Label 2
Label 3
Label 4
. I want to create a slicer in Power Bi to filter by the column values in
Label
Label 1
Label 2
Label 3
Label 4
. The issue is that this gets confusing when choosing which column value to filter by, as the same column value exists within different columns.问题在于,在选择要过滤的列值时,这会让人感到困惑,因为不同的列中存在相同的列值。 For example, If I wanted to filter by
Apples
, I would need to select multiple Apples
values from Label
Label 1
Label 2
and Label 4
. For example, If I wanted to filter by
Apples
, I would need to select multiple Apples
values from Label
Label 1
Label 2
and Label 4
.
How can I create a slicer in Power BI to ensure I can filter uniquely by: Apples
Oranges
Pears
Bananas
Strawberries
Dragon Fruit
Grapes
?如何在 Power BI 中创建切片器以确保我可以按以下条件进行唯一过滤:
Apples
Oranges
Pears
Bananas
Strawberries
Dragon Fruit
Grapes
?
Create disconnected table for alllabel:为 alllabel 创建断开连接的表:
AllLabel = SUMMARIZE(UNION(VALUES(Fruit[Label 1]), VALUES(Fruit[Label 2]), VALUES(Fruit[Label 3]), VALUES(Fruit[Label 4])),Fruit[Label 1])
Create a measure:创建度量:
PickThis =
var _selectedFruit = SELECTEDVALUE(AllLabel[Label 1])
return
CALCULATE(COUNTROWS(Fruit) , FILTER(Fruit,Fruit[Label 1] = _selectedFruit || Fruit[Label 2] = _selectedFruit || Fruit[Label 3] = _selectedFruit || Fruit[Label 4] = _selectedFruit))
Add measure to your visualization (or to filter):将度量添加到您的可视化(或过滤器):
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.