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
CSpina
Helper III
Helper III

Error when I try to get a value from another table

Hi guys.

 

Maybe I dont know how to do it, but I need do get a value from one table to another. I have this table and I need to get this value in another table (red).

 

2020_08_26_09_25_44_Window1.png

 

When I try to use this calculate:

 

fator_20 = CALCULATE(SUM(fatorSucateamento[fator]), FILTER(fatorSucateamento,fatorSucateamento[numero_anos]='fProdução'[anos_sucateamento]),fatorSucateamento[id_sucateamento]='fProdução'[id_sucateamento])

 

I am getting an error:

 

A expressão contém várias colunas, mas somente uma única coluna pode ser utilizada em uma expressão True/False usada como expressão de filtro de tabela.

 

2020_08_26_11_06_42_Geomarketing_e_Frota_Power_BI_Desktop.png

 

 Any thoughts?

 

Thanks.

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hello @CSpina ,

In the Filter function, you are missing the "&&" symbol, try the following formula.

fator_20 = 
CALCULATE (
    SUM ( fatorSucateamento[fator] ),
    FILTER (
        fatorSucateamento,
        fatorSucateamento[numero_anos] = 'fProdução'[anos_sucateamento]
            && fatorSucateamento[id_sucateamento] = 'fProdução'[id_sucateamento]
    )
)

E1.jpg

If you don't meet your requirements, could you show the exact expected result based on the table you shared?

Best regards

Community Support Team _ zhenbw

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

BTW, pbix as attached.

View solution in original post

4 REPLIES 4
v-zhenbw-msft
Community Support
Community Support

Hello @CSpina ,

In the Filter function, you are missing the "&&" symbol, try the following formula.

fator_20 = 
CALCULATE (
    SUM ( fatorSucateamento[fator] ),
    FILTER (
        fatorSucateamento,
        fatorSucateamento[numero_anos] = 'fProdução'[anos_sucateamento]
            && fatorSucateamento[id_sucateamento] = 'fProdução'[id_sucateamento]
    )
)

E1.jpg

If you don't meet your requirements, could you show the exact expected result based on the table you shared?

Best regards

Community Support Team _ zhenbw

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

BTW, pbix as attached.

Thanks very much, that´s it.

Greg_Deckler
Community Champion
Community Champion

@CSpina You need to use RELATED, RELATEDTABLE or LOOKUPVALUE when referring to those columns in another table. The error you are getting is because you are essentially returning all of the rows of that table and then trying to compare it to something.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@CSpina , can provide some sample data.

You can copy in the following way

examples

// from item to sales - from Item on 1 side of 1 to M

Item Name = RELATED('item'[Brand])

//month to sales 1 to M

Month Name = LOOKUPVALUE('date'[Month Year],'date'[Date],Sales[Sales Date])

// from City to sales  1-M. But also possible in m-1 or M to M. filter need to key filters , you can use sumx, minx xountx too
City Name = maxx(FILTER(geography,geography[City Id]=Sales[City Id]),geography[City])

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

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.