Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Return a distinct value from a column

Hi there,

I have a table looking like this:

IDanotherIDValidValue
1101.01.20230,5
2501.01.20231,5
3401.02.20232,5
4201.02.20233,5
1101.02.20230,55
2501.02.20231,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's avatar
    ERD
    Icon for Community Champion rankCommunity 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]) )
  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you!