Power BI 中的 SUM IF [英] SUM IF in Power BI

查看:61
本文介绍了Power BI 中的 SUM IF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以对 Power BI 中的条件求和?

Is it possible to SUM on conditions in Power BI?

我有一列包含 UK 和 Italy 的值以及其他列:员工和花费的小时数.

I have a column that contains the values UK and Italy alongside other columns: employee and hours spent.

我想制定一个衡量标准来显示一名员工在意大利花费的总小时数,另一个衡量一名员工在英国花费的总小时数.

I want to make a measure to show total hours spent by an employee in Italy and another to show total hours spent by an employee in UK.

我对 DAX 语言不满意.有人可以帮忙吗?

I am having no luck with the DAX language. Can anyone help?

推荐答案

是的.有两种基本方法.

Yes. There are two basic approaches to this.

CALCULATE(SUM(TableName[Hours]), TableName[Country] = "Italy")

SUMX(FILTER(TableName, TableName[Country] = "Italy"), TableName[Hours])

这篇关于Power BI 中的 SUM IF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆