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
Anonymous
Not applicable

Cross 2 table to calculate

Hi everyone,

I got a problem...it seems so simple but I actually cannot solve it 😞

 

Table 1

N°           Amount

C1            x

C2            y

 

Table 2

N°            Currency factor

C1             0

C2             1.12

 

And I would like :

Report Table

N°          Total Amount (if currency factor=0 => Amount, else => Amount/CurrFactor)

C1           x

C2           y/1.12

 

And I would like to have the sum = x+y/1.12

 

Is it easy?

Thank you so much

5 REPLIES 5
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

If there is an existing relationship between 'Table1' and 'Table2', you could take Zubair_Muhammad's suggestion which can return expected result.

 

If there is no relationship between tables, you could try:

Total Amount =
IF (
    LOOKUPVALUE ( Table2[Currency Factor], Table2[N], Table1[N] ) = 0,
    Table1[Amount],
    Table1[Amount] / LOOKUPVALUE ( Table2[Currency Factor], Table2[N], Table1[N] )
)

When you add 'Table1'[N] and 'Table1'[Total Amount] into a table visual, it will automatically calculate the sum in Total row.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I can't choose Table1[N]...only the measures from the Table1...

So I create a measure on the Table1 with SUM(Amount).

 

Then, the LOOKUP issue doesn't work neither... 😞 Error!

Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Assuming there is a relationship between Table1 and Table2,

add this calculated column in Table1

 

Total Amount =
IF (
    RELATED ( Table2[Currency Factor] ) = 0,
    Table1[Amount],
    DIVIDE ( Table1[Amount], RELATED ( Table2[Currency Factor] ) )
)
Anonymous
Not applicable

There is an active relationship (on N°) but it reacts as it does not. "RELATED" doesn't work...

 

So I can't write this lines (and I don't know why)...

Hi @Anonymous,

 

Since there is an active relationship, please try this:

Total Amount =
CALCULATE (
    IF (
        Table2[Currency Factor] = 0,
        Table1[Amount],
        DIVIDE ( Table1[Amount], Table2[Currency Factor] )
    ),
    USERELATIONSHIP ( Table1[N], Table2[N] )
)

 Besides, why can't you choose Table1[N] to table visual? I think you should provide more detailed information about your actual tables.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.