Forum Discussion
Anonymous
6 years agoNot applicable
New column returns sum only when ID is specific
Hello Power BI experts π I ran into a problem, seems easy, but I can't figure it out. I am creating a new column, a simple SUM (from another column), but I only want this sum to appear only...
- 6 years ago
Hi Anonymous ,
You can do like this.
1. Create a column in Table2.
Column = CALCULATE( SUM(Table2[Value]), FILTER( Table2, Table2[ID] = EARLIER( Table2[ID]) && Table2[ID] = 2 ) )2. Create a column in Table 1.
Column = LOOKUPVALUE( Table2[Column], Table2[ID], Table1[ID] )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lionel-msft
Community Support
6 years agoHi Anonymous ,
You can do like this.
1. Create a column in Table2.
Column =
CALCULATE(
SUM(Table2[Value]),
FILTER(
Table2,
Table2[ID] = EARLIER( Table2[ID]) && Table2[ID] = 2
)
)
2. Create a column in Table 1.
Column =
LOOKUPVALUE(
Table2[Column],
Table2[ID], Table1[ID]
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.