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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
r_fioretti
Helper I
Helper I

SUMMARIZE two tables many to many Relationship

I'm trying to get this in Excel (Edit DAX in Table) and I need the column 'table2'[DesPro], but I can't figure it out how to do that.

 

So far, I have:

FILTER(
    SUMMARIZE(
        table1,
        table1[NF Saída],
        table1[Título],
        table1[Total],
        table1[Ult. Pgto],
        'table2'[DesPro] --  where table1[NF Saída]='table2'[Nota Fiscal] with many to many relationship. A union table with all distinct values from both tables had been created
    ),
        table1[Ult. Pgto] <> BLANK()&&table1[Ult. Pgto] >= DATE(2023, 1, 1)
)
 
 
I appreciate any help.
4 REPLIES 4
Anonymous
Not applicable

Hi @r_fioretti ,

 

Please try:

Table=
FILTER(
    SUMMARIZE(
        table1,
        table1[NF Saída],
        table1[Título],
        table1[Total],
        table1[Ult. Pgto],
        "DesPro",MAX('Table2'[DesPro])
    ),
        table1[Ult. Pgto] <> BLANK()&&table1[Ult. Pgto] >= DATE(2023, 1, 1)
)

vtangjiemsft_0-1705975019881.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Hi,
I'm using Excel and It didn't work. It brings just the MAX value. Instead, I need to bring all values.
I don’t know why but I can’t attach an example file. Here’s a link to access it. SUMMARIZE-Ex.xlsx 
I appreciate.



Anonymous
Not applicable

Hi @r_fioretti ,

 

Model Relationship:

vtangjiemsft_0-1706082617206.png

Please try:

Table = FILTER(
    SUMMARIZE(
        table1,
        table1[NF Saída],
        table1[Título],
        table1[Total],
        table1[Ult. Pgto],
        "DesPro",LOOKUPVALUE('Table2'[DesPro],'Table2'[Nota Fiscal],'Table1'[NF Saída])
    ),
        table1[Ult. Pgto] <> BLANK()&&table1[Ult. Pgto] >= DATE(2023, 1, 1)
)

Or:

Table = FILTER(
    SUMMARIZE(
        table1,
        table1[NF Saída],
        table1[Título],
        table1[Total],
        table1[Ult. Pgto],
        "DesPro",CALCULATE(SUM('Table2'[DesPro]),FILTER(ALL('Table2'),'Table2'[Nota Fiscal]=EARLIER('Table1'[NF Saída])))
    ),
        table1[Ult. Pgto] <> BLANK()&&table1[Ult. Pgto] >= DATE(2023, 1, 1)
)

Best Regards,

Neeko Tang

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

Hi,
It didn’t work.

In Power BI the relationship many to many works well. Unfortunately, I need this model in Excel to meet the final user needs. I have an intermediary table with unique values as a work around to this many to many relationships, it should work but it isn’t.




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.