英文:
How to calculate SUM with filter using DAX?
问题
我将首先筛选列,然后计算其总和。
我是这样做的
Total = SUMX(FILTER('Backlog items', 'Backlog items'[Name]="*Student*"),[Score])
我需要计算[Score]
的总和,当[Name]
包含Student
时,但结果仍然为空,因为它无法捕捉筛选条件。
有人能帮我想个办法吗?
非常感谢您的帮助。
英文:
I am going to calculate the sum of a column by filtering it first.
I did this way
Total = SUMX(FILTER('Backlog items', 'Backlog items'[Name]="*Student*"),[Score])
I need to calculate the sum of [Score]
when the [Name]
contains of Student
, but the result is still empty, because it can't catch the filter.
Anyone can help me to have an idea about it?
Thank you so much for the help.
答案1
得分: 1
你可以使用CONTAINSSTRING函数,例如像这样:
Total = SUMX(
FILTER('Backlog items',
CONTAINSSTRING('Backlog items'[Name], "Student")
), [Score])
英文:
You can use CONTAINSSTRING function, for example like this:
Total = SUMX(
FILTER('Backlog items',
CONTAINSSTRING('Backlog items'[Name], "Student")
), [Score])
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论