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! Learn more

Reply
Anonymous
Not applicable

SUMX on many to many relationship and IF statements on selections across tables

I wonder if I coud have some help on a problwm which I am sure has been faced before. There is really two parts to this problem

 

Part 1 - Basically, I have a Fact table, consiting of values for BRES data (Employment) which details number of jobs in certain sectors over the years. That is easily displayed on a line chart, using measures to do the slice, and then sum of the value, against Date on the x axis. One to Many relationship, easy peasy.
However, as part of the line chart, I need to show the SUMX of those same values, multiplied by a value on a seperate table dependant on the LSOA that it refers to. The issue is that this table is a many to many relationship. I have attached a simplyfied version of the data model.

ChrisJackson_0-1665520025683.png

There are a few oddities. The main slice will be 'Port dictionary' [Port Name], which runs through and sums up all the values from eth relevant attached LSOA's. The difficulty comes from the Synthetic side of the model. For each port, there is a relevant synthetic port, which we would like to use as a comparison. The synthetic port will not include any of the LSOA values that are in eth original sliced group, and will use another LSOA value and apply a multiplication value to get the number we need (this is the best way to do the analysis and cant be changed). There may however be two synthetic ports that use the same LSOA, but appy different multiplication values. While sliced, there will never be a multiplication on an LSOA, on either port side, or synthetic port side. I have tried SUMX, but as the table isn't sliced all the time, it confuses the DAX because of the many to many relationship. 

 

Part 2.

 

I would like the selection of the Synthetic port dictionary name on the right, to be dependent on the selction of the Port Name on the left. e.g if I select 'Port A' on the slicer, it will also slice the right hand side by 'Synthetic port A'. I was hoping that I can then use this value to give a 'true, false' statement using a SWITCH, which i could then apply as a calculated column and essentially have a dynamic filter on the table (this is seemingly impossible). That would have actually helped me create a 1-many relationship.

 

I cant share the data itself, but if anybody has the inclination to try and solve eiether of these issues, then I would try to create a pbix with some dummy data for you to try it.

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

Hard to follow without any data. Please consider to share the pbix.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 .

 

Best Regards,

Jay

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