Forum Discussion
otter1
3 years agoNew Member
Column with one value per group
Hello, I have a table with very small granularity: Category 1 Category 2 Category 3 Category 4 Sales A X 1 202 400 A X 1 203 400 B Y 2 109 650 B Y 2 204 650 ...
- 3 years ago
Hi, otter1
You can try the following methods.
Column = Var _minCat4=CALCULATE ( MIN ( 'Table'[Category 4] ), ALLEXCEPT ( 'Table', 'Table'[Category 1] ) ) Return IF ( [Category 4] = _minCat4, CALCULATE ( MAX ( 'Table'[Sales] ), FILTER ('Table', [Category 1] = EARLIER ( 'Table'[Category 1] ) && [Category 2] = EARLIER ( 'Table'[Category 2] ) && [Category 3] = EARLIER ( 'Table'[Category 3] ) ) ), BLANK () )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti
Community Support
3 years agoHi, otter1
You can try the following methods.
Column =
Var _minCat4=CALCULATE ( MIN ( 'Table'[Category 4] ),
ALLEXCEPT ( 'Table', 'Table'[Category 1] ) )
Return
IF ( [Category 4] = _minCat4,
CALCULATE ( MAX ( 'Table'[Sales] ),
FILTER ('Table',
[Category 1] = EARLIER ( 'Table'[Category 1] )
&& [Category 2] = EARLIER ( 'Table'[Category 2] )
&& [Category 3] = EARLIER ( 'Table'[Category 3] )
)
),
BLANK ()
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.