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
Applicable88
Impactful Individual
Impactful Individual

Calculated table with summarizing of another table in a many to many relationship

Hello,

recently someone taught me that for summarizing columns from two different tables there is no need for related() function. 

But when I try to add addtional filter in it the syntax is greyed out. I have a Fact table and a materialtable. Both are connected via Material columns. They exist in a many to many relationship. 

 

Facttable:

OrderDateTypeStatusCategory Material
1234501.01.20215LLDLVRManuZZZ
1234602.01.20218ZLDLVRManuZZZ
1234703.01.2021888PRCCManuZZZ
1234804.01.2021888PRCCPlanZZZ
1234905.01.2021888PRCCPlanZZZ
1235006.01.2021888PRCCManuBB
1235107.01.2021888PRCCManuBB

 

Materialtable:

 

Material TotalAmountDateReserve
ZZZ200006.07.202111
ZZZ200006.07.202158
ZZZ200006.07.202133
ZZZ200006.07.202177
ZZZ200007.07.202155
ZZZ200008.07.202144
BB200009.07.202133
BB200010.07.202155


I first tried to just grouping the materialtable to one date and add sum of the reserve as an extra column:

Summarizedtable = ADDCOLUMNS(SUMMARIZE(Material, Material[Date],Material[TotalAmount],Material[Material]),"SumRes", calculate(sum(Material[Reserve])))

So now I have all materials grouped to one date. In the next step I actually tried to filter my new calculated table to following conditions which are based on another table, the fact table: Only show me the materials of orders where  Type = 888 or 8ZL, Status <> "DLVR", Category = "Plan"

So I added the conditions like these into the summarize part of the Summarizedtable:

'FACT'[Type] in {"888","8ZL"} ,NOT(CONTAINSSTRING('FACT'[Status],"DLVR")),'FACT'[CATEGORY] = "PLAN"))
But its all greyed out. 
How can I group the table and at the same time filter it?
Thank you very much in advance.
Best. 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Applicable88 

Your issue is circular dependencies in relationships. This issue is caused by you build the relationship from new table to Material Table. Your new table is a calcualted table by Dax depends on Materials table, so you builld relationship from it to Material Table may cause circular dependencies error. You can try to build the relationship from Material Table to new table. I have a test by your sample and it works.

Build relationship from new table to Material Table, we will get issue.

1.png

Build relationship from Material Table to new table, it works.

2.png

Here is a blog for circular dependencies, you may refer to it for more details.

 

Best Regards,

Rico 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

3 REPLIES 3
Applicable88
Impactful Individual
Impactful Individual

@amitchandak thanks.

The formula works, but if I connect the new table to the material table I get "circle dependencies" , what can I do to avoid this?

 

Anonymous
Not applicable

Hi @Applicable88 

Your issue is circular dependencies in relationships. This issue is caused by you build the relationship from new table to Material Table. Your new table is a calcualted table by Dax depends on Materials table, so you builld relationship from it to Material Table may cause circular dependencies error. You can try to build the relationship from Material Table to new table. I have a test by your sample and it works.

Build relationship from new table to Material Table, we will get issue.

1.png

Build relationship from Material Table to new table, it works.

2.png

Here is a blog for circular dependencies, you may refer to it for more details.

 

Best Regards,

Rico Zhou

 

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

amitchandak
Super User
Super User

@Applicable88 , You should be add those condition in new column you want to add from fact

'FACT'[Type] in {"888","8ZL"} ,NOT(CONTAINSSTRING('FACT'[Status],"DLVR")),'FACT'[CATEGORY] = "PLAN"))

 

or try calculatetable like

ADDCOLUMNS(SUMMARIZE(calculatetable(Material,

'FACT'[Type] in {"888","8ZL"} ,NOT(CONTAINSSTRING('FACT'[Status],"DLVR")),'FACT'[CATEGORY] = "PLAN"), Material[Date],Material[TotalAmount],Material[Material]),"SumRes", calculate(sum(Material[Reserve])))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.