Forum Discussion
search with multiple criteria
Hi v-zhangti ,
Thank you for your help. We are almost there.
When i used your calculation, i get double values as output. The values needs to be unique and if there is no another unique value anymore than 0.
See below result for an example:
Hi, angelikakolacz
Like the example you provided, what are the results you expect? Because his result is one-on-two.
Best Regards
- angelikakolacz4 years ago
Helper I
Hi v-zhangti
Something like this:
ACCOUNT NUMBER INVOICE NUMBER AMOUNT FACTUURTYPe PERIODE OPENSTAAND Output test 2 382 81000009569743 141 INV jan-21 0 81000009570262 382 81000006224300 141 INV jan-21 0 81000006224463 382 81000009570262 -141 CM jan-21 0 81000009569743 382 81000006224463 -141 CM jan-21 0 81000006224300 If one value is already used, it's not possible to use them twice. If there is not an other value, then 0.
Best regards
- v-zhangti3 years ago
Community Support
Hi, angelikakolacz
Add an index column to your data in Power Query.
Column:
Rank = CALCULATE ( COUNT ( 'Table'[ACCOUNT NUMBER] ), FILTER ( 'Table', [Index] <= EARLIER ( 'Table'[Index] ) && [AMOUNT] = EARLIER ( 'Table'[AMOUNT] ) && [PERIODE] = EARLIER ( 'Table'[PERIODE] ) ) )Column = CALCULATE ( MAX ( 'Table'[INVOICE NUMBER] ), FILTER ( 'Table', [ACCOUNT NUMBER] = EARLIER ( 'Table'[ACCOUNT NUMBER] ) && [PERIODE] = EARLIER ( 'Table'[PERIODE] ) && [AMOUNT] = - EARLIER ( 'Table'[AMOUNT] ) && [Rank] = EARLIER ( 'Table'[Rank] ) ) )Result:
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.
- angelikakolacz3 years ago
Helper I
Hi v-zhangti
It's seems like it doesn't work at my file. When i try to make a retun column the file crashes. Will you try at my file?