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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
paulsnet1986
Helper I
Helper I

Issue: Formula Works in Card, but Breaks Table

Table 1 (Source: Internal Database)

Equipment Record Number

Expected COGS

 

Table 2 (Source: Financial Reporting)

Equipment Record Number

Actual COGS

 

One-to-many relationship: there are multiple line items per Equipment Record Number in table two.

 

Formula: Cost Variance = SUM('Table 1'[Expected COGS]) - SUM('Table 2'[Actual COGS])

 

When added to a card, I get the expected total variance: $269.

 

But when I add the formula to my table, it creates thousands of lines of the same record and value, when there are only a few hundred records in total.

 

paulsnet1986_0-1629234299369.png

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @paulsnet1986 ,

 

I can reproduce your issue when use the "Equipment Record Number" column from Table 2, instead of Table 1. Please use the ERN column from Table 1, not Table 2.

 

ERN.gif

 

 

Best Regards,

Icey

 

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
Icey
Community Support
Community Support

Hi @paulsnet1986 ,

 

I can reproduce your issue when use the "Equipment Record Number" column from Table 2, instead of Table 1. Please use the ERN column from Table 1, not Table 2.

 

ERN.gif

 

 

Best Regards,

Icey

 

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

Ashish_Mathur
Super User
Super User

Hi,

Create a third table (Table3) with a single column which has all unique Equipment record numbers.  Create a relationship between the ERN number of Table1 and Table2 to Table3.  To your visual, drag ERN from Table3.  Drag your measure to the visual.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

@paulsnet1986 Are the tables related to one another? Likely you are getting a cartesian product of all the rows in both tables. Something along those lines.


@ 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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors