简体   繁体   English

如何在 Power BI 中筛选包含相同值的多个列?

[英]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 Label 1 Label 1 Label 2 Label 2 Label 3 Label 3 Label 4 Label 4
1000 1000 Apples苹果 Grapes葡萄 Bananas香蕉 Oranges橘子 Strawberries草莓
1001 1001 Oranges橘子 Pears Apples苹果 Bananas香蕉 Strawberries草莓
1002 1002 Pears Dragon Fruit火龙果 Apples苹果 Strawberries草莓 Dragon Fruit火龙果
1003 1003 Bananas香蕉 Oranges橘子 Apples苹果 Grapes葡萄 Pears
1004 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.

相关问题 如何在 Power BI 中过滤带有度量的折线图? - How to filter a Line Chart with a Measure in Power BI? 如何将Power BI中的时间序列转换为时间段 - How Can I Transform Time Series in Power BI Into Time Bins Power BI-如何可视化具有一定值的行的百分比以及那些值大于或小于数字的行的百分比? - Power BI - How can I visualize percent of rows with a certain value and of those rows, percent with a value above or below a number? 如何从 Power BI 连接到 SQL 服务器数据库? - How do I connect to a SQL Server database from Power BI? Power BI:如何汇总值? - Power BI: How to summarize values? 如何基于具有相同元素的列将SQL表拆分为多个? - How can I split a SQL table into multiple based on columns which have the same elements? power bi中涉及多个字段的1对多关系 - 1 to many relationship involving multiple fields in power bi 如何使相同类型的 2 个或更多列具有唯一值组合 MySQL - How can I make 2 or more columns of the same type have have unique value combinations MySQL 检查同一值集中的多个列的值 - Checking value of multiple columns in a same value set 如何使用多个旧列的值创建新列? - How can I create new columns with the values of multiple old columns?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM