简体   繁体   English

在 Power BI 中使用 DAX 显示每行的“总计”(sum)

[英]To display “total” (sum ) of each row using DAX in Power BI

I have the following format of data:我有以下格式的数据:

Machine Name | Error_code_a | Error_code_b | Error_code_c | Error_code_d 
MA01         |   0          |  1           |     0        | 0
MA02         |   1          |  0           |     1        | 0
MA02         |   1          |  1           |     1        | 0

Where 0 and 1 simply represents if an error code is present or absent.其中01仅表示是否存在错误代码。

I need one column where the TOTAL or SUM is displayed.我需要一列显示TOTALSUM

Example for MA01 , the sum column should show 1 , for MA02 it should show 2 (since 1+1).MA01为例,总和列应显示1 ,对于MA02应显示2 (从 1+1 开始)。

I am able to do this column wise, but need some DAX query for doing it row wise.我能够明智地执行此列,但需要一些 DAX 查询才能明智地执行此操作。

so turns out it was pretty straight forward: We need to create a new column / custom column / measure and then : MySum = [error_code_a] + [error_code_b] + [error_code_c] + so on and you will get a new column which is basically summing up each row!事实证明这很简单:我们需要创建一个新列/自定义列/度量,然后:MySum = [error_code_a] + [error_code_b] + [error_code_c] + 依此类推,您将得到一个新列,基本上是总结每一行!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM