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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bharka
Regular Visitor

lookupvalue filtering 2 columns

Hi,

 

sorry if this problem was already solved here, i was trying to find it but none of the solutions i found helped (but i'm a beginner).

 

I have two tables: 

tab1.jpgtab2.jpg

i need to get the passing coefficients from the second table to the first one as a new column. Both group 1 and group 2 can be duplicate but the combinations of the groups are unique. The coefficients do not have to be unique. obviously i can't use LOOKUPVALUE and i'm kind of stuck here. Can anyone help me please?

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@bharka

 

Try this

 

coef =
CALCULATE (
    FIRSTNONBLANK ( Table2[Coef], 1 ),
    FILTER (
        Table2,
        Table2[group1] = Table1[group1]
            && Table2[group2] = Table1[group2]
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
Community Champion

@bharka

 

Try this

 

coef =
CALCULATE (
    FIRSTNONBLANK ( Table2[Coef], 1 ),
    FILTER (
        Table2,
        Table2[group1] = Table1[group1]
            && Table2[group2] = Table1[group2]
    )
)

Regards
Zubair

Please try my custom visuals

It works well, but just wonder why the lookupvalue function dosen't work?

I had the same problem, thank so much

it works, thank you @Zubair_Muhammad!

@bharka

 

LookupValue should also work. Try this

 

coef =
LOOKUPVALUE (
    Table2[coef],
    Table2[group1], Table1[group1],
    Table2[group2], Table1[group2]
)

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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