Function not working because of stored value

I'm trying to get this function to work

if([_THISROW].[Region]="Domestic",
  select(Daily Allowances[Hotel],
     and(
       [Classification]=[_THISROW].[Classification],
       [Passport type]=[_THISROW].[Passport],
       [Region]=[_THISROW].[Region])
     ),
  select(Daily Allowances[Hotel],
     and(
       [Classification]=[_THISROW].[Classification],
       [Region]=[_THISROW].[Region])
  )
)

The logic looks like it should work, but it isn't. 

Even when I try simplyifying the code, it still doesn't generate the correct response.

if([_THISROW].[Region]="Domestic",
    "Domestic",
    "Not Domestic"   
)

What I think I have learned is that the [Region] value is storing the unique ID, not the value itself. I'm specifically pulling it from a table instead of using an Enum because I need to pull the Region value into various places. 

However, I have tried replacing the "Domestic" with the unique ID value being stored in that field, but it still isn't working.

Where am I going wrong?

Solved Solved
0 1 121
1 ACCEPTED SOLUTION

Okay, I worked it out. Posting here for anyone else who's trying to achieve something similar. Here's the correct code

 

any(select(lookup_Regions[Region], [Row ID] = [_THISROW].[Region])) = "Domestic",

 

which replaces

 

[_THISROW].[Region]="Domestic",

 

I needed to go find the correct column in the lookup_Regions table.

View solution in original post

1 REPLY 1

Okay, I worked it out. Posting here for anyone else who's trying to achieve something similar. Here's the correct code

 

any(select(lookup_Regions[Region], [Row ID] = [_THISROW].[Region])) = "Domestic",

 

which replaces

 

[_THISROW].[Region]="Domestic",

 

I needed to go find the correct column in the lookup_Regions table.

Top Labels in this Space