Forum Discussion
Anonymous
2 years agoNot applicable
Return a distinct value from a column
Hi there,
I have a table looking like this:
| ID | anotherID | Valid | Value |
| 1 | 1 | 01.01.2023 | 0,5 |
| 2 | 5 | 01.01.2023 | 1,5 |
| 3 | 4 | 01.02.2023 | 2,5 |
| 4 | 2 | 01.02.2023 | 3,5 |
| 1 | 1 | 01.02.2023 | 0,55 |
| 2 | 5 | 01.02.2023 | 1,55 |
And I am trying to return the value from column value by looking up the entries in column "anotherID" in column "ID". With my current measure, I do return the sum of "values", but I would like to have the filter also set on the valid date.
See here my measure:
CALCULATE(SUM(Table[Value]), ALL(Table), Table[anotherID.] IN VALUES (Table[ID]))
But this returns for ID 1 for example the sum of 0,5 and 0,55 --> 1,05
How can I add the Filter for the explicite date? I have tried to extend the calculate measure but nothing changes.
CALCULATE(SUM(Table[Value]), ALL(Table), Table[anotherID.] IN VALUES (Table[ID]), Table[Valid]) --> does not return the right value.
Thanks for your help.
Hi Anonymous , is this what you'd like to achieve?
v1 = CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table' ), 'Table'[anotherID] IN VALUES ( 'Table'[ID] ), VALUES('Table'[Valid]) )
2 Replies
- ERD
Community Champion
Hi Anonymous , is this what you'd like to achieve?
v1 = CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table' ), 'Table'[anotherID] IN VALUES ( 'Table'[ID] ), VALUES('Table'[Valid]) ) - AnonymousNot applicable
Thank you!