The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have the following table and i need to have the selection for the product with quantity > 2 and in the highest category
a first and c the last
id | category | qty | selection |
1 | a | 2 | x |
1 | b | 3 | |
1 | c | 4 | |
2 | a | 1 | |
2 | b | 2 | x |
2 | c | 3 |
Solved! Go to Solution.
@PatrickNahayo Assuming that you mean >= 2 then perhaps this:
Selection Column =
VAR __ID = [id]
VAR __CurrentCategory = [category]
VAR __Category = MINX( FILTER( 'Table', [id] = __ID && [qty] >= 2 ), [category] )
VAR __Result = IF( __CurrentCategory = __Category, "x", BLANK() )
RETURN
__Result
@PatrickNahayo Assuming that you mean >= 2 then perhaps this:
Selection Column =
VAR __ID = [id]
VAR __CurrentCategory = [category]
VAR __Category = MINX( FILTER( 'Table', [id] = __ID && [qty] >= 2 ), [category] )
VAR __Result = IF( __CurrentCategory = __Category, "x", BLANK() )
RETURN
__Result
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |