admin管理员组文章数量:1122846
Data Table:
Color | Amount |
---|---|
Red | 5 |
Blue | 3 |
Red | 5 |
Blue | 6 |
Data Table:
Color | Amount |
---|---|
Red | 5 |
Blue | 3 |
Red | 5 |
Blue | 6 |
Main Table:
Color | Count |
---|---|
Red | 10 |
Blue | 9 |
Green | 0 |
Hello I have two tables that deal with gumballs let's say, and I am trying to make a calculated column called "Count" in my Main Table that will basically sum all the amounts of gumballs from Data Table grouped by color. Data Table is available to me, and I am showing what I want the Main Table to look like.
What I tried so far: I established a one to many relationship in modal view for color in main table to color in data table.
Count =
CALCULATE(
SUM(RELATED(DATA_TABLE[Amount])),
MAIN_TABLE[Color] = RELATED(DATA_TABLE[Color])
)
This is the DAX expression I tried but anything after "Related" is underlined red and it says "Parameter is not the correct type / Cannot find name '[Amount]' / Cannot find name '[Color]'" and now I'm not sure what to do. I am making this calculated column in the Main Table.
Share Improve this question asked Nov 22, 2024 at 16:26 Cur FromskyCur Fromsky 273 bronze badges1 Answer
Reset to default 0make sure you have created the relationship between two tables and try this to create a column
Column = CALCULATE( sum('Data'[Amount]))+0
本文标签:
版权声明:本文标题:powerbi - How to create a calculated column that is the sum of values from another table grouped by similar column value? - Stac 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302361a1931506.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论