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
NNaj
Helper IV
Helper IV

Measure is adding entries from relationship table, I only want it to apply to the data set entries

Hi All,

 

I have written this measure that adds values of specific trade ID's.

 

Value = CALCULATE(SUM(Table[Absolute value]),Table(Table[ID]), Table[WIN_FLAG] = TRUE()).
 
In another table, I have ID's and company names to help identify which companies are being referred to. In this table there are more companies and ID's than in dataset. This is where I believe my problem is arising. (e.g. ID 1 is company A, ID 2 is company B,..)
 
When I add the measure above to my table, it correctly computes the values for the ID's in my data set but it also adds rows to my table for the other companies not referred to in my dataset. How can I avoid this?
 
Apologies if I havent worded my problem suitably, its a tough one to explain.
 
Any help will be appreciated.

 

1 ACCEPTED SOLUTION
Washivale
Resolver V
Resolver V

Hi @NNaj ,

 

First thing you would need to check is relationships between both tables (ID Table and Value table).

 

I assume your win flag and value table is same.

once you have relationship set on both tables, use ID from your ID table in Your visual and below measure.

Create below two measures and check if any renders correct results for your dataset.

 

Value = CALCULATE(SUM(Table[Absolute value]), Table[WIN_FLAG] = TRUE())

value1 = sumx(Filter( Table,  Table[WIN_FLAG] = TRUE()), Table[Absolute value])

 

let me know if it works.

 

Thank You,

Washivale

View solution in original post

1 REPLY 1
Washivale
Resolver V
Resolver V

Hi @NNaj ,

 

First thing you would need to check is relationships between both tables (ID Table and Value table).

 

I assume your win flag and value table is same.

once you have relationship set on both tables, use ID from your ID table in Your visual and below measure.

Create below two measures and check if any renders correct results for your dataset.

 

Value = CALCULATE(SUM(Table[Absolute value]), Table[WIN_FLAG] = TRUE())

value1 = sumx(Filter( Table,  Table[WIN_FLAG] = TRUE()), Table[Absolute value])

 

let me know if it works.

 

Thank You,

Washivale

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.