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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
snifer
Post Patron
Post Patron

relation between table and calculation

       
 table 1    table 2
idreferenceresult km  idkm
1002005+20=25  1005
10130010+30=40  10110
10240015+40=55  10215
     20020
     30030
     40040
       
       

 

 

there is a relationship between "id" columns of table 1 and table 2 as many to one, cross filter direction single

 

so I want to look for id and reference from table 1 in table 2 take the value "km" and show as result  the sum of them  in the column "Result km"

 

 

1 ACCEPTED SOLUTION

Hi @snifer

I ignore the many to one relation from table1 to table2, when i use my formula in table2, it show the same error as yours, but it is correct in the table, please refer to my first method.

11.png

 

Create calculated columns in table1

Column = LOOKUPVALUE(Sheet2[km],Sheet2[id],Sheet1[id])

Column 2 = LOOKUPVALUE(Sheet2[km],Sheet2[id],Sheet1[reference])

Column 3 = IF([Column 2]<>BLANK(),[Column]+[Column 2])

12.png

 

Best Regards

maggie

View solution in original post

5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @snifer

You could create calculated columns in table1

Column = LOOKUPVALUE(Sheet2[km],Sheet2[id],Sheet1[id])

Column 2 = LOOKUPVALUE(Sheet2[km],Sheet2[id],Sheet1[reference])

Column 3 = [Column]+[Column 2]

3.png

Or create calculated columns in table2

Column = LOOKUPVALUE(Sheet1[reference],Sheet1[id],Sheet2[id])

Column 2 = CALCULATE(SUM(Sheet2[km]),FILTER(ALL(Sheet2),[id]=EARLIER(Sheet2[Column])))

Column 3 = IF(ISBLANK([Column 2]),BLANK(),[km]+[Column 2])

4.png 

 

 

Best Regards

Maggie

doesn't work it gives  me this error "a table of multiple values was supplied where a single value was expected''

Hi @snifer

I ignore the many to one relation from table1 to table2, when i use my formula in table2, it show the same error as yours, but it is correct in the table, please refer to my first method.

11.png

 

Create calculated columns in table1

Column = LOOKUPVALUE(Sheet2[km],Sheet2[id],Sheet1[id])

Column 2 = LOOKUPVALUE(Sheet2[km],Sheet2[id],Sheet1[reference])

Column 3 = IF([Column 2]<>BLANK(),[Column]+[Column 2])

12.png

 

Best Regards

maggie

Hi @snifer

Could you show me a screenshot where error occurs?

What do you do when it shows an error?

 

Best Regards

Maggie

snifer
Post Patron
Post Patron

can you look if there an easy solution?

@Zubair_Muhammad

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors