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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cdawidow
Helper III
Helper III

Total Sales is duplicate

problem.PNG

 

Hi guys, I am wondering if there is a way to fix this.  My total sales calculation is right, but my sales by contract name is duplicated. Any fix> please see below for my model.

 

model.PNG

 

6 REPLIES 6
amitchandak
Super User
Super User

@cdawidow , You can create a bridge table like.

contract Name = distinct(union(all(Hope[contract Name]),all(contracts[contract Name])))

 

The same way you can create other dimensions/master/bridge tables

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

Well I just changed my model hopefully you can see below.  What I did was I concatenated both the sales and contract tables to create a relationship but still even with this bridge I created my total values were still wrong

 

bridge.PNG

 

Anonymous
Not applicable

Contracts (2) stores unique names of contracts as much as I understand. Why do you then have many-to-many between Contracts (2) and Contracts? Second question, why is the connection between Contracts and Sales many-to-many with bi-dir filtering? Bi-dir filtering and many-to-many are EXTREMELY DANGEROUS constructs and should be used with UTMOST care (please refer to Power BI documentation). In other words, you should NOT use them if you're just starting learning Power BI.

If you want to create simple, fast and easy to understand models, please read about dimensional modeling that also is the foundation of Power BI modeling. The documentation on Power BI is a good place to start. There are tons of vids on YT as well that explain how you should model data.

If you neglect this part of learning, you'll be sorry rather sooner than later. You run the risk of producing wrong numbers without ever realizing it.

Taking your advice as we speak,  Thanks so much 

Greg_Deckler
Community Champion
Community Champion

@cdawidow - 9 times out of 10 that's an issue with the relationship. It's almost certainly caused by having many-to-many relationships. I would seek to eliminate those using bridge tables most likely.



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks for the help!

I just have one unique column in my tables (Contract Name) which is distinct to only its table.  How would I create a bridge table that could allow me to calculate total sales by contract name?  Thanks in advance

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.