Getting Duplicates in drop down menu using row label

I have a table (CITY) of cities with multiple venues per city. I would like to choose a city then have a dependent dropdown with the venue. I currently have a separate column in the CITY table as a unique key and using row label to have the CITY names in the dropdown referenced from the main table. This is so users can add new venues or I would just use an easy VALID_IF reference.
It seems I could use the UNIQUE(CITY[CITY]) but cannot figure out where to put it??

Any help would be appreciated, THANKS!

0 5 243
5 REPLIES 5

Hi @Clifford, if I understand you correctly, you want a dropdown enum type from the CityColumn of the CityTable to be unique.

You may try something like this in the Valid_If:

SELECT(CityTable[CityColumn], TRUE, TRUE)

Which should give you only those unique city from the CityTable.

And to make easier for selecting the enum City name with an alphabetic selection, you may want to consider also to wrap it with SORT(), such as:

SORT(SELECT(CityTable[CityColumn], TRUE, TRUE))

Thanks Heru -
The problemn I am encountering is that it is the CITY Column from the MainTable is REF column -
so for the Valid_if I need to use CityTable[KEY] (key being a unique id), and cannot find a way to then filter duplicate city names. Is there a way to combine both conditions?

Thanks!

Please inform your actual table names and also column names, sorry for misunderstanding from my side.

Apologies - The Valid_If of the MAIN TABLE CITY Ref type column is CITY[KEY], I need to somehow then filter the duplicatesโ€ฆ

Thanks!

I see your table structure, however @Clifford I have to say that I need to learn more to be able to do what you want with that table structure. Maybe others can give better suggestion on this.

Unless, if you want to change the [CITY] of the MAIN TABLE to enum type, you could use something like CITY[CITY] in the Valid_If dropdown setting. It will give you the unique city name.

Top Labels in this Space