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

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

问题描述

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



我有一列包含值UK和Italy以及其他列:员工和工作时间。 / p>

我想采取一种措施来显示意大利一名员工的总工作时间,并显示英国一名员工的总工作时间。



我没有DAX语言的运气。谁能帮忙?

解决方案

是。有两种基本方法。

  CALCULATE(SUM(TableName [Hours]),TableName [Country] =意大利 )

  SUMX(FILTER(TableName,TableName [Country] =意大利),TableName [小时])


Is it possible to SUM on conditions in Power BI?

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.

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")

or

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

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

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