- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Return Value based on Multiple Distinct Values in different column
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-11-2019 03:36 AM
Hi all,
I have unique ID's with multiple payment types - I'm trying to write a formula that'll look at the different values for each ID and return the same value for both rows - i.e. if one ID has the payment types "Payment Scheme" & "Standard", it should return "Payment Scheme" in both rows. There's probably only 3 or 4 different combinations of values
This is my scenario & expected ouput:
Unique ID | Payment Types | Output |
1 | Payment Scheme | Payment Scheme |
1 | Standard | Payment Scheme |
2 | Payment Scheme | Payment Scheme |
2 | Standard | Payment Scheme |
3 | Payment Scheme | Payment Scheme |
3 | Standard | Payment Scheme |
4 | Refund | Standard |
4 | Standard | Standard |
5 | Payment Scheme | Payment Scheme |
5 | Standard | Payment Scheme |
6 | Invoice | Invoice |
6 | Standard | Invoice |
7 | Refund | Standard |
7 | Standard | Standard |
8 | Refund | Standard |
8 | Standard | Standard |
9 | Pay4Later | Payment Scheme |
9 | Payment Scheme | Payment Scheme |
9 | Refund | Payment Scheme |
10 | Payment Scheme | Payment Scheme |
10 | Standard | Payment Scheme |
11 | Invoice | Invoice |
11 | Standard | Invoice |
12 | Invoice | Invoice |
12 | Standard | Invoice |
Can't figure out the DAX for this for the life of me - any tips?
Thanks,
Patrick
Solved! Go to Solution.
Accepted Solutions
Re: Return Value based on Multiple Distinct Values in different column
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-11-2019 08:35 AM
See if this works:
Column = VAR __table = FILTER(ALL('Table18'),[Unique ID] = EARLIER([Unique ID])) RETURN SWITCH(TRUE(), CONTAINS(__table,[Payment Types],"Payment Scheme"),"Payment Scheme", CONTAINS(__table,[Payment Types],"Invoice"),"Invoice", CONTAINS(__table,[Payment Types],"Standard"),"Standard", [Payment Types] )
Table 18 of attached.
Did I answer your question? Mark my post as a solution!
Proud to be a Datanaut!
All Replies
Re: Return Value based on Multiple Distinct Values in different column
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-11-2019 08:35 AM
See if this works:
Column = VAR __table = FILTER(ALL('Table18'),[Unique ID] = EARLIER([Unique ID])) RETURN SWITCH(TRUE(), CONTAINS(__table,[Payment Types],"Payment Scheme"),"Payment Scheme", CONTAINS(__table,[Payment Types],"Invoice"),"Invoice", CONTAINS(__table,[Payment Types],"Standard"),"Standard", [Payment Types] )
Table 18 of attached.
Did I answer your question? Mark my post as a solution!
Proud to be a Datanaut!