Forum Discussion
Anonymous
8 years agoNot applicable
Summing / retrieving values based on Distinct Key
I have two related tables Table A contains a unique key and some qty attached to it, e.g. _Key | QTY UniqueKey1 | 5 UniqueKey2 | 10 UniqueKey3 | 1 Uni...
- 8 years ago
Here is what you need to, set relationship between both tables on key field.
and add following column in Tableb
Qty = RELATED(Tablea[Qty])
Unique = FORMAT(Tableb[Date], "YYYYMMDD") & Tableb[Key]Add following measures in table b
Max Qty = MAX(Tableb[Qty])
Qty SUM = SUMX(VALUES(Tableb[Unique]),[Max Qty])Add table visual, drop date from tableb and Qty SUM measure
parry2k
8 years agoSuper User
Here is what you need to, set relationship between both tables on key field.
and add following column in Tableb
Qty = RELATED(Tablea[Qty])
Unique = FORMAT(Tableb[Date], "YYYYMMDD") & Tableb[Key]
Add following measures in table b
Max Qty = MAX(Tableb[Qty])
Qty SUM = SUMX(VALUES(Tableb[Unique]),[Max Qty])
Add table visual, drop date from tableb and Qty SUM measure