Issue with relationships, ref_rows and filtering

I have a table for campsites visited called Trip Planning and within this table I have various statuses of camp sites such as "suggestions", "confirmed" "completed", et cetera. I also have another table called attractions, this is for attractions related to a county in Ireland, when I create a campsite suggestion or confirmation I will include the county in which the county that is confirmed and I would like the related attractions, from the attractions table, that shares the same county for that confirmed booking to appear from the attractions table below. They both share a county field which is the same validation on the Google spreadsheet.
The table for the campsite is called trip planning and the table for the attractions it's called simply attractions they both share a "county" field which is the same.
I have tried to get the attractions to show up in trip planning by using slices to dynamically fetch those in which a confirmed booking has the same county where there is an attraction in. But I have not been successful in figuring out this expression.

In the table "Trip Planning" I have created a virtual column called "Related Attractions" as type "List" with the following formula REF_ROWS("County Specific", "County").
In attractions I have created the slice "County Specific' using the following formula: [County] = [_THISROW].[County]

In the editor for the campsites I can display columns on the page in a specific order, and now I am looking for related attractions in this column order however I don't see it I wonder why?


Any Help appreciated!

Solved Solved
0 2 84
1 ACCEPTED SOLUTION

You may want to use SELECT() instead of REF_ROWS in your case. I am uncertain if your [County] column in the Attractions table is set as a REF column or just a TEXT or other type of column. But I think using SELECT() might be a better option. So here is a proposed solution for [Related Attractions], you will need to edit as necessary to adjust for your table names and column names:

SELECT(AttractionsTable[KeyColumn], [County] = [_THISROW].[County])

The use of slices is probably not necessary here.

View solution in original post

2 REPLIES 2

You may want to use SELECT() instead of REF_ROWS in your case. I am uncertain if your [County] column in the Attractions table is set as a REF column or just a TEXT or other type of column. But I think using SELECT() might be a better option. So here is a proposed solution for [Related Attractions], you will need to edit as necessary to adjust for your table names and column names:

SELECT(AttractionsTable[KeyColumn], [County] = [_THISROW].[County])

The use of slices is probably not necessary here.

Thank you! This works perfectly and you are correct no slices needed!

Top Labels in this Space