是否有解决方案来获取行等于 0 的列列表?

Is there a solution to get a list of columns that rows are equal to 0?

我正在构建一个 Power Bi 问答仪表板,该仪表板会根据特定标准显示通过或失败。 1表示通过,0表示失败。如果任何类别失败,则整行都失败。

示例:

Rep Name Categories 1 Categories 2 Categories 3 Pass/Fail
Bob Smith 1 1 1 1
Tyler Jones 1 0 0 0

我正在寻找的是一种说法,如果 (Pass/Fail) = 0 然后列出所有列的值 = 0。

在这个例子中,我应该得到 Tyler Jones Failed in Criteria 2 & 3 的结果

在 Dax 或 Mcode 中执行此操作的最佳方法是什么?

您可以取消对类别的透视并使用 CONCATENAX。下面的例子。

M变换:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcspPUgjOzSzJUNJRMkTBsTrRSiGVOalFCl75eanFUHEDOI6NBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Rep Name" = _t, #"Categories 1" = _t, #"Categories 2" = _t, #"Categories 3" = _t, #"Pass/Fail" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Rep Name", type text}, {"Categories 1", Int64.Type}, {"Categories 2", Int64.Type}, {"Categories 3", Int64.Type}, {"Pass/Fail", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Rep Name", "Pass/Fail"}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Pass/Fail"})
in
    #"Removed Columns"

DAX 指标:

FailAts = CONCATENATEX(CALCULATETABLE ( VALUES ( 'Table (2)'[Attribute] ),'Table (2)'[Value] = 0 ), 'Table (2)'[Attribute]," ")