Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi community,
I'm quite new to powerbi, and have a specific usecase I cannot figure out. I hope you can help me out here.
I have the following two tables:
Event
| EventID | EventName |
| 1 | Birthday |
| 2 | Wedding |
| 3 | Party |
Guest
| Guest | EventID | GuestLocation |
| 1 | 1 | Outside |
| 2 | 1 | Outside |
| 3 | 2 | Inside |
| 4 | 2 | Inside |
| 5 | 3 | Inside |
| 6 | 3 | Outside |
The two tables are related through EventID. What I want as a result is to have an extra column in table "Event", which checks the location of the guests that are present at a specific EventID. Since for EventID 3, there are 2 different locations, I want to return that as "Both". I'm searching for the following result:
| EventID | EventName | GuestLocation |
| 1 | Birthday | Outside |
| 2 | Wedding | Inside |
| 3 | Party | Both |
In my current situation I have two possible locations, but in the future this might be 3 or 4. So if that could be taken into account, that would be really nice. If that is really difficult I'm happy with a solution for two locations.
I'm looking for a solution in DAX.
Solved! Go to Solution.
@Elzzie PBIX is attached below signature.
GuestLocation =
VAR __Table = SUMMARIZE( RELATEDTABLE(Guest), [GuestLocation] )
VAR __Rows = COUNTROWS( __Table )
VAR __Result =
IF(
__Rows = 1,
MAXX( __Table, [GuestLocation] ),
"Multiple (" & __Rows & ")"
)
RETURN
__Result
@Greg_Deckler,
Thank you so much for this, my projectmanager will be very happy on Monday.
It is not giving back the strings I would like, but I fixed that with another column matching the different options to the corresponding string I need.
Enjoy your weekend!
@Elzzie PBIX is attached below signature.
GuestLocation =
VAR __Table = SUMMARIZE( RELATEDTABLE(Guest), [GuestLocation] )
VAR __Rows = COUNTROWS( __Table )
VAR __Result =
IF(
__Rows = 1,
MAXX( __Table, [GuestLocation] ),
"Multiple (" & __Rows & ")"
)
RETURN
__Result
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 53 | |
| 42 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 123 | |
| 106 | |
| 44 | |
| 32 | |
| 24 |