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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
dashmarley11
Helper I
Helper I

New Table that Calculates SUMPRODUCT from two separate tables

I'm trying to create a new table that calculates a SUMPRODUCT using values from 2 separate tables (T1 and T2).

T1

TermFTP Rate

1

.0549
2.0548
3.0547
4.0520
5.0511
6.0501

 

T2

TermPmt-3Pmt-6
181,44139,705
281,78039,870
382,12140,036
4 40,203
5 40,371
6 40,359

 

NEWTable

Pmt-3RtSUMPRODUCT('T1' A1:A6, 'T1' B1:B6, 'T2' B1:B6)/SUMPRODUCT('T1' A1:A6, 'T2' B1:B6)
Pmt-6RtSUMPRODUCT('T1' A1:A6, 'T1' B1:B6, 'T2' C1:C6)/SUMPRODUCT('T1' A1:A6, 'T2' C1:C6)
1 ACCEPTED SOLUTION
v-yilong-msft
Community Support
Community Support

Hi @dashmarley11 ,

It seems that Power BI does not directly support the SUMPRODUCT function as it is known in Excel. But I think you can use LOOKUPVALUE function.

I create two tables as you mentioned.

vyilongmsft_0-1715564569191.png

Then I create a measure and here is the DAX code.

SUMPRODUCT Measure =
SUMX ( T1, T1[FTP Rate] * LOOKUPVALUE ( T2[Pmt-3], T2[Term], T1[Term] ) )
    / SUMX ( T1, LOOKUPVALUE ( T2[Pmt-3], T2[Term], T1[Term] ) )

Finally you will get what you want.

vyilongmsft_2-1715565098044.png

 

 

 

Best Regards

Yilong Zhou

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

View solution in original post

2 REPLIES 2
v-yilong-msft
Community Support
Community Support

Hi @dashmarley11 ,

It seems that Power BI does not directly support the SUMPRODUCT function as it is known in Excel. But I think you can use LOOKUPVALUE function.

I create two tables as you mentioned.

vyilongmsft_0-1715564569191.png

Then I create a measure and here is the DAX code.

SUMPRODUCT Measure =
SUMX ( T1, T1[FTP Rate] * LOOKUPVALUE ( T2[Pmt-3], T2[Term], T1[Term] ) )
    / SUMX ( T1, LOOKUPVALUE ( T2[Pmt-3], T2[Term], T1[Term] ) )

Finally you will get what you want.

vyilongmsft_2-1715565098044.png

 

 

 

Best Regards

Yilong Zhou

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

Greg_Deckler
Super User
Super User

@dashmarley11 Try:

SUMPRODUCT = 
    VAR __Table = 
        ADDCOLUMNS(
            'Table1',
            "Value",[Value1] * RELATED(Table2[Value2])
        )
RETURN
    SUMX(__Table,[Value])

 

Comes from here: S Excel to DAX Translation - Microsoft Fabric Community


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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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