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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
AllanBerces
Post Prodigy
Post Prodigy

Lookup with Filter

Hi Good day,

Can anyone assist me on my code, base from my current code i want to add filter on a specific column.

 

My current code:

AllanBerces_0-1720144596095.png

I want to add filter on coloumn:

Table: BSP TA
Column 1: Project Name = ABCDE

Column 2: Main Cat. = Q

 

Base_Scope =
VAR lookupResult = LOOKUPVALUE(sign_off[sign off], sign_off[Job Card], 'BSP TA'[Job card])
RETURN IF(ISBLANK(lookupResult), "Injected", lookupResult)
 
Thank you

 

1 ACCEPTED SOLUTION

Hi @Samarth_18 thank you for the help, its working now.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @AllanBerces ,

 

As I understand it, you want to filter the table based on two column values and then use the LOOKUPVALUE later.

Please try as followings:

 

Base_Scope =
VAR ProjectName =MAX('BSP TA'[Project Name])
VAR MainCat = MAX('BSP TA'[Main Cat.])
VAR JobCard = MAX('BSP TA'[Job card])
RETURN
    IF(
        ProjectName = "ABCDE" && MainCat = "Q",
        IF(
            ISBLANK(
                LOOKUPVALUE(
                  sign_off[sign off],
                    sign_off[Job Card],
                    JobCard
                )
            ),
            "Injected",
            LOOKUPVALUE(
                sign_off[sign off],
                sign_off[Job Card],
                JobCard
            )
        ),
        BLANK()
    )

 

Sample data from the sign-off table:

vyajiewanmsft_0-1720159823158.png

 

Before:

vyajiewanmsft_0-1720159521695.png

After:

vyajiewanmsft_1-1720159541749.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous , @Ashish_Mathur 

Good day,

I try the solution above but show blank. Can pls help me to solve my issue. Pls refer to the link.

 

https://drive.google.com/file/d/1NV1BiF6qCEq2L2HPMhYwim1Xxxfm1lCc/view?usp=sharing

https://drive.google.com/file/d/1NV1BiF6qCEq2L2HPMhYwim1Xxxfm1lCc/view?usp=sharing

Thank you

Hi,

Try this

Project Name = LOOKUPVALUE('Main Data'[Project Name], 'Main Data'[Job card], 'Sign off'[Job Card] ,'Main Data'[Main Cat.],"Q",'Main Data'[Project Name],"ABCDE")

This will return a blank because there is no ABCDE entry in the Project name column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur showing error on this part

AllanBerces_0-1720857905489.png

AllanBerces_1-1720857989426.png

 

Thank you

Hi @AllanBerces ,

You could try the following code:-

Project Name =
LOOKUPVALUE(
    'Main Data'[Project Name],
    'Main Data'[Job card], RELATED('Sign off'[Job Card]),
    'Main Data'[Main Cat.], "Q",
    'Main Data'[Project Name], "ABCDE"
)

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi @Samarth_18 thank you for the help, its working now.

AllanBerces
Post Prodigy
Post Prodigy

Hi follow up to my query 

I want first to filter the table before it do lookup.

Table: BSP TA
Column 1: Project Name = ABCDE

Column 2: Main Cat. = Q

Hi,

Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors