Forum Discussion
Count unique values in other table
- 4 years ago
Hi,
you have confused the two Table.
If this post is useful to help you to solve your issue consider giving the post a thumbs up
and accepting it as a solution !
- 4 years ago
Hi FrederikB ,
You can create measures like this to get the result:
total bookings = DISTINCTCOUNT('bookings'[id])Persons with bookings = VAR tab = SUMMARIZE ( 'bookings', 'bookings'[personId], "total bookings", [total bookings] ) RETURN COUNTX ( tab, [personId] )Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your reply, but I am not sure that I either understand what you mean, or that the provdided solution solves the problem.
It seems like 'Persons with bookings' is summed to four, even though only 3 unique persons have gotten a booking.
Hi FrederikB ,
You can create measures like this to get the result:
total bookings = DISTINCTCOUNT('bookings'[id])Persons with bookings =
VAR tab =
SUMMARIZE (
'bookings',
'bookings'[personId],
"total bookings", [total bookings]
)
RETURN
COUNTX ( tab, [personId] )
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.