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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Help with Multiply columns by reference table

 

Hi, 

 

I need help with multiplying different columns. First, sum columns Sales and Pro then muliply it by the Growth from the other table when it match the name. 

 

I've done with the vlookup but now trying to use DAX. 

 

 

NameSalePro
Aby1515
John 81416
Diana 5219
Lia22219
Jim 6519
Jim 21520
Jim 2233
Diana 21522
Aby6423
Aby5122
John 656233
John 1326526
John 32698
Diana 5128

 

 

Name Growth A Growth B
Aby0.50.08
John 0.040.6
Diana 0.090.1
Lia0.070.1
Jim 0.090.1

 

Thank you in advance!

1 ACCEPTED SOLUTION
sokg
Solution Supplier
Solution Supplier

First you have to create a relationship as pic below.Capture.JPG

 

then write these measures

 

Growth A Measure =
SUMX (
    'Sales Table';
    'Sales Table'[Sale] * 'Sales Table'[Pro]
        * RELATED ( 'Growth Table'[Growth A ] )
)

and

 

Growth B Measure =
SUMX (
    'Sales Table';
    'Sales Table'[Sale] * 'Sales Table'[Pro]
        * RELATED ( 'Growth Table'[Growth B] )
)

and the result is

 

Capture1.JPG

View solution in original post

4 REPLIES 4
sokg
Solution Supplier
Solution Supplier

First you have to create a relationship as pic below.Capture.JPG

 

then write these measures

 

Growth A Measure =
SUMX (
    'Sales Table';
    'Sales Table'[Sale] * 'Sales Table'[Pro]
        * RELATED ( 'Growth Table'[Growth A ] )
)

and

 

Growth B Measure =
SUMX (
    'Sales Table';
    'Sales Table'[Sale] * 'Sales Table'[Pro]
        * RELATED ( 'Growth Table'[Growth B] )
)

and the result is

 

Capture1.JPG

Anonymous
Not applicable

Thank you, but I faced a little problem for some reason I was getting divided by two.  I just added ' *2 '  at the end. It works. 

 

 

TomMartens
Super User
Super User

Hey,

basically you can achieve something similar like VLOOKUP from Excel by using the DAX formula LOOKUPVALUE ...

 

and because (v1 + v2 + ...) * y is the same as v1 * y + v2 * y + ...

 

you can create a calculated column in table1

 

Assuming the 1st table is called table1 and the 2nd table is called table2 the DAX for this calculated column in table1 may look like this:

 

calc column in table1 = 
'table1'[Sale] * LOOKUPVALUE('table2'[Growth A], 'table2'[Name], 'table1'[Name])

 

To create a similar column in table2 the DAX gets a little more complex

calc column in table2 =
var currentName = 'table2'[Name]
return 
'table2'[Growth A]*
CALCULATE(
    SUM('table1'[Sale])
    ,FILTER(
        ALL('table1')
        ,'table1'[Name] = currentName
    )
)

 

Hopefully this is what you are looking for!

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
PattemManohar
Community Champion
Community Champion

@Anonymous Could you please post your expected output as well.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.