Forum Discussion
search with multiple criteria
Hi, angelikakolacz
Your problem can be solved with a simple calculation column.
Column =
Var Output=CALCULATE (
MAX ( 'Table'[INVOICE NUMBER] ),
FILTER (
'Table',
[ACCOUNT NUMBER] = EARLIER ( 'Table'[ACCOUNT NUMBER] )
&& [PERIODE] = EARLIER ( 'Table'[PERIODE] )
&& [INVOICE AMOUNT] = - EARLIER ( 'Table'[INVOICE AMOUNT] )
)
)
Return
IF(Output=BLANK(),0,Output)
Considering that your quantity is relatively large, you can also use measure to solve this problem.
Measure:
Output =
Var Output=CALCULATE (
MAX ( 'Table'[INVOICE NUMBER] ),
FILTER (
ALL('Table'),
[ACCOUNT NUMBER] = SELECTEDVALUE( 'Table'[ACCOUNT NUMBER] )
&& [PERIODE] = SELECTEDVALUE( 'Table'[PERIODE] )
&& [INVOICE AMOUNT] = - SELECTEDVALUE( 'Table'[INVOICE AMOUNT] )
)
)
Return
IF(Output=BLANK(),0,Output)
Hope that helps you.
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.
- angelikakolacz4 years ago
Helper I
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:- v-zhangti4 years ago
Community Support
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