Forum Discussion
Find the Distinct Value based on other columns
- 9 years ago
Hi timstacy1,
It seems that there are some Guests have multiple Hosts with the same last Report Date. For example, Server A has both Host A and Host B with the last report date 04/17/2017 in your table like below.
Guest Host Report Date server A Host A 4/17/2017 server A Host B 4/17/2017 server A Host C 4/3/2017 server A Host D 3/20/2017 server A Host E 2/20/2017 server A Host F 2/13/2017 So what's your expected result in this scenario, show only Host A, or both Host A and B for Server A in the list?
If you still need a list of distinct guests and one host per guest, the formula below show work in your scenario. :smileyhappy:
HostLatestReport = CALCULATE ( FIRSTNONBLANK ( Table2[Host], 1 ), FILTER ( ALLEXCEPT ( Table2, Table2[Guest] ), Table2[Report Date] = [LatestReport] ) )Regards
- 9 years ago
Hi timstacy1,
Glad to help! Could you accept helpful replies as solution to close this thread? :smileyhappy:
Regards
Hi timstacy1,
It seems that there are some Guests have multiple Hosts with the same last Report Date. For example, Server A has both Host A and Host B with the last report date 04/17/2017 in your table like below.
| Guest | Host | Report Date |
| server A | Host A | 4/17/2017 |
| server A | Host B | 4/17/2017 |
| server A | Host C | 4/3/2017 |
| server A | Host D | 3/20/2017 |
| server A | Host E | 2/20/2017 |
| server A | Host F | 2/13/2017 |
So what's your expected result in this scenario, show only Host A, or both Host A and B for Server A in the list?
If you still need a list of distinct guests and one host per guest, the formula below show work in your scenario. :smileyhappy:
HostLatestReport =
CALCULATE (
FIRSTNONBLANK ( Table2[Host], 1 ),
FILTER (
ALLEXCEPT ( Table2, Table2[Guest] ),
Table2[Report Date] = [LatestReport]
)
)
Regards