Forum Discussion
Show maximum values per category
i have a table where i want to filter so it shows the maximum values (not value) per category by weight
here is an example
| merchant | category | weight |
| mer1 | a | 4 |
| mer1 | a | 4 |
| mer1 | a | 4 |
| mer2 | a | 1 |
| mer2 | a | 1 |
| mer2 | a | 1 |
| sar1 | b | 7 |
| sar1 | b | 7 |
| sar1 | b | 7 |
| sar2 | b | 2 |
| sar2 | b | 2 |
| sar2 | b | 2 |
i want to filter so the table show the 3 rows of mer1 and 3 rows of sar 1
- Anonymous4 years ago
Hi giorgiokatr ,
Please reer to my pbix file to see if it helps you.
Create a measure.
bigcategory_ = VAR _maxvalue = MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[category] = SELECTEDVALUE ( 'Table'[category] ) ), 'Table'[weight] ) RETURN IF ( MAX ( 'Table'[weight] ) = _maxvalue, 1, BLANK () )Or a column.
bigcategory_column = VAR _maxvalue = MAXX ( FILTER ( ( 'Table' ), 'Table'[category] = EARLIER( 'Table'[category] ) ), 'Table'[weight] ) RETURN IF ( ( 'Table'[weight] ) = _maxvalue, 1, BLANK () )Then filter the column or measure.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi giorgiokatr ,
Please reer to my pbix file to see if it helps you.
Create a measure.
bigcategory_ = VAR _maxvalue = MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[category] = SELECTEDVALUE ( 'Table'[category] ) ), 'Table'[weight] ) RETURN IF ( MAX ( 'Table'[weight] ) = _maxvalue, 1, BLANK () )Or a column.
bigcategory_column = VAR _maxvalue = MAXX ( FILTER ( ( 'Table' ), 'Table'[category] = EARLIER( 'Table'[category] ) ), 'Table'[weight] ) RETURN IF ( ( 'Table'[weight] ) = _maxvalue, 1, BLANK () )Then filter the column or measure.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.