Dependent dropdown create a List with Ref from two tables

Hi all,
I have 3 tables 

DEPENDENCED DROPDOWNDEPENDENCED DROPDOWN

  1. UTENTE
  2. ALIMENTI
  3. SESSIONE

In SESSIONEUTENTE will enter the details of his breakfast, lunch, etc., based on his diet. In fact, the ALIMENTI table is a table that provides different foods for three types of diets: VEGAN, VEGETARIAN, OMNIVORED.
So every time a user claims to be VEGAN (UTENTE DASDASDASDASDAS and CIBO VEGANO text label), VEGETARIAN or OMNIVORED, the ALIMENTI table (CIBO VEGANO) shown in the dropdown should filter the type of food!
But that doesn't work!

I tried many solutions:

FILTER("ALIMENTI",IN([CAT],UTENTE[CATEGORIA]))
SELECT(ALIMENTI[NOME], CONTAINS([CATEGORIA], [CAT]))
FILTER("ALIMENTI",IN([CAT],ALIMENTI[CATEGORIA]))
FILTER("ALIMENTI",IN([CAT],UTENTE[CATEG]))
FILTER("ALIMENTI",IN([_THISROW].[CAT],ALIMENTI[CATEGORIA]))
SELECT(ALIMENTI[NAME], ALIMENTI[CATEGORIA] = UTENTE[CATEG])
SELECT(ALIMENTI[NAME], INTERSECT ([_THISROW].[CAT], [CATEGORIA])=[CAT])

 Please help me!

Solved Solved
0 3 147
1 ACCEPTED SOLUTION

I guess my confusion is understanding what "Utente" was.  It's the User?


@danieledr wrote:
@WillowMobileSys wrote:

You probably need to change the "[Utente]" column names to those that are actually in your table ALEMENTI and the column in the table used by current row


Sorry, but I'm not understand.


Because of lack of understanding, my usage of "Utente" probably didn't match with your columns.  You needed to update the proper columns.

But now that I see your ALEMENTI table and understand 'Utente" is User, this is the expression I think you need:

FILTER("ALIMENTI",  [Categoria] = [_THISROW].[Utente].[Categoria])

Again I am assuming the column name in your "Utente" table.  You will need to adjust [_THISROW].[Utente].[Categoria], by replacing "Categoria" with correct column where you are recording the diet type for the user.  And again I am assuming that those values in the Utente table for the user will be VEGAN, VEGETARIAN or OMNIVORED.

View solution in original post

3 REPLIES 3

I am not certain if we have all the details but I'll try.

There are two parts:

What type of column is "CIBO VEGANO" defined as?  This will determine how the dropdown list expression should be configured.

The expression needs to incorporate the "Utente" selected value in some way to properly filter.  Based on you post, it seems the "Utente" value is used to reduce the dropdown list items.  To do this the "Alimenti" table must have a column to match to.  Then the expression would be something like:

FILTER("ALIMENTI",  [Utente] = [_THISROW].[Utente])

NOTE:  This expression assumes that "CIBO VEGANO" is defined as a REF type column.  You probably need to change the "[Utente]" column names to those that are actually in your table ALEMENTI and the column in the table used by current row.   These two columns should have the same values list to properly match and filter.


@WillowMobileSys wrote:

Con che tipo di colonna si definisce "CIBO VEGANO"?   Ciò determinerà come configurare l'espressione dell'elenco a discesa.


with ALIMENTI column, it defined as a REF type column!

Tnx @WillowMobileSys 

I have a ALIMENTI table:

ALIMENTI tableALIMENTI table

 

 

with duplicate  value, but it must be filter by last column CATEGORIA, so I can't put every UTENTE in every ALIMENTI[VEGANO] row!


@WillowMobileSys wrote:

You probably need to change the "[Utente]" column names to those that are actually in your table ALEMENTI and the column in the table used by current row


Sorry, but I'm not understand.


@WillowMobileSys wrote:

These two columns should have the same values list to properly match and filter.


ok, I see don't have same value to match properly, this same value are in SESSIONE table (first img on question post).

So I have a UTENTE table to start app, SESSIONE table to register user data and ALIMENTI table to supply different diet (VEGAN, VEGETARIAN, OMNIVORED) to SESSIONE filter by diet for UTENTE.

Hope I was clearer now
Thanks in advance for response

I guess my confusion is understanding what "Utente" was.  It's the User?


@danieledr wrote:
@WillowMobileSys wrote:

You probably need to change the "[Utente]" column names to those that are actually in your table ALEMENTI and the column in the table used by current row


Sorry, but I'm not understand.


Because of lack of understanding, my usage of "Utente" probably didn't match with your columns.  You needed to update the proper columns.

But now that I see your ALEMENTI table and understand 'Utente" is User, this is the expression I think you need:

FILTER("ALIMENTI",  [Categoria] = [_THISROW].[Utente].[Categoria])

Again I am assuming the column name in your "Utente" table.  You will need to adjust [_THISROW].[Utente].[Categoria], by replacing "Categoria" with correct column where you are recording the diet type for the user.  And again I am assuming that those values in the Utente table for the user will be VEGAN, VEGETARIAN or OMNIVORED.

Top Labels in this Space