Forum Discussion
angelikakolacz
Helper I
4 years agosearch with multiple criteria
Hello, I have a table with more than milion rows with data from different customers. I’m looking for a dax formule that gives me the following result (see column output): ACCOUNT NUMBER INVO...
v-zhangti
Community Support
4 years agoHi, angelikakolacz
Like the example you provided, what are the results you expect? Because his result is one-on-two.
Best Regards
angelikakolacz
Helper I
4 years agoHi 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?