Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
rupa1006
Frequent Visitor

Hi all ,i have a requirement below and getting argument 4 lookup value required


if (custoemr is in A table AND if the BU type is not "UT", "DT", "PT") or if customer number = 5150
then = 'In' else 'OUT'

 

INOUT=
IF (
OR (
AND (
NOT ISBLANK (
LOOKUPVALUE (
'ASP vw_A'[businessUnitName],
'ASP vw_A'[businessUnitNumber],
'ASP vw_B'[CustomerNumber]
)
),
NOT OR (
SELECTEDVALUE('ASP vw_A'[BU Type]) IN {"UT", "DT", "PT"}
)
),
'ASP vw_B'[CustomerNumber] = 5150
),
"IN",
"OUT"
)

 

1 ACCEPTED SOLUTION
123abc
Community Champion
Community Champion

 

Here's the corrected version of your code:

 

INOUT =
IF (
OR (
AND (
NOT ISBLANK (
LOOKUPVALUE (
'ASP vw_A'[businessUnitName],
'ASP vw_A'[businessUnitNumber],
'ASP vw_B'[CustomerNumber]
)
),
NOT OR (
SELECTEDVALUE('ASP vw_A'[BU Type]) IN {"UT", "DT", "PT"}
)
),
'ASP vw_B'[CustomerNumber] = 5150
),
"IN",
"OUT"
)

 

 

In this code, I've corrected the LOOKUPVALUE function to use the correct syntax. The first argument of LOOKUPVALUE is the column that contains the values you want to retrieve, and the second argument is the column used for matching. Make sure you replace 'ASP vw_A'[businessUnitName] with the actual column you want to retrieve values from and 'ASP vw_A'[businessUnitNumber] with the column used for matching.

If you're still facing issues, please provide more details or context about the tables and columns you're working with, and I'll do my best to assist you.

View solution in original post

1 REPLY 1
123abc
Community Champion
Community Champion

 

Here's the corrected version of your code:

 

INOUT =
IF (
OR (
AND (
NOT ISBLANK (
LOOKUPVALUE (
'ASP vw_A'[businessUnitName],
'ASP vw_A'[businessUnitNumber],
'ASP vw_B'[CustomerNumber]
)
),
NOT OR (
SELECTEDVALUE('ASP vw_A'[BU Type]) IN {"UT", "DT", "PT"}
)
),
'ASP vw_B'[CustomerNumber] = 5150
),
"IN",
"OUT"
)

 

 

In this code, I've corrected the LOOKUPVALUE function to use the correct syntax. The first argument of LOOKUPVALUE is the column that contains the values you want to retrieve, and the second argument is the column used for matching. Make sure you replace 'ASP vw_A'[businessUnitName] with the actual column you want to retrieve values from and 'ASP vw_A'[businessUnitNumber] with the column used for matching.

If you're still facing issues, please provide more details or context about the tables and columns you're working with, and I'll do my best to assist you.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.