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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Antmkjr
Post Patron
Post Patron

Lookup a table after filtering certain values in the table

CountrySalesRankContinentSl
India1003Asia1
Pakistan503Asia2
France951Europe4
China903Asia3
India894NULL1

 

I have a Table A as shown above, and Table B as below:

 

CountrySlSales
India1#ERROR
Pakistan2#ERROR
China3#ERROR

 

Im looking up Sales from Table A in Table B, However I want to lookup Table A excluding Continent = NULL,

How to frame the DAX for lookup by excluding the mentioned row from table A.

AnuTomy_0-1653675441096.png

 

1 ACCEPTED SOLUTION

Hi @Antmkjr,

 

You could change the data type of the Measure by Column tools.

vcazhengmsft_0-1654052628048.png

 

Or make a little bit change to the Measure itself.

LookUpSales =
var res=SUMX (
    FILTER (
        'Table A',
        'Table A'[Country] = 'Table B'[Country]
            && 'Table A'[Continent] <> "NULL"
            && 'Table A'[Sl] = 'Table B'[Sl]
    ),
    'Table A'[Sales]
)
return CONVERT(res,STRING)

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

View solution in original post

5 REPLIES 5
v-cazheng-msft
Community Support
Community Support

Hi @Antmkjr,

 

You need make some changes to your Calculated column formula.

LookUpSales =
SUMX (
    FILTER (
        'Table A',
        'Table A'[Country] = 'Table B'[Country]
            && 'Table A'[Continent] <> "NULL"
            && 'Table A'[Sl] = 'Table B'[Sl]
    ),
    'Table A'[Sales]
)

 

Then, the result looks like this.

vcazhengmsft_0-1653975629208.png

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

In this case its fine, but what if the value i have to return is text

Hi @Antmkjr,

 

You could change the data type of the Measure by Column tools.

vcazhengmsft_0-1654052628048.png

 

Or make a little bit change to the Measure itself.

LookUpSales =
var res=SUMX (
    FILTER (
        'Table A',
        'Table A'[Country] = 'Table B'[Country]
            && 'Table A'[Continent] <> "NULL"
            && 'Table A'[Sl] = 'Table B'[Sl]
    ),
    'Table A'[Sales]
)
return CONVERT(res,STRING)

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

amitchandak
Super User
Super User

@Antmkjr , a New column in Table B

 

Sumx(filter( 'Table A', 'Table A'[Country] = 'Table b'[Country] ), 'Table A'[Sales])

 

or

 

 

Sumx(filter( 'Table A', 'Table A'[Country] = 'Table b'[Country] && 'Table A'[sl] = 'Table b'[sl] ), 'Table A'[Sales])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

AnuTomy_0-1653743791291.png

In this case of both of these its Summing up the sales of India where Continent = NULL , i want to completely ignore that record      

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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