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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
williamdasilva
Regular Visitor

Calculated Column breaks Relationships

When adding a calculated column to the output values on a visual (grid), the relationship seems to be broken and a "full outer join" is applied between the two implicated tables.

 

Basic tables involved:

 

Records

  • RecordID (unique)
  • Name
  • Calculate field = COUNTROWS(Filter(Actions,Actions[Action Campaign ID] = "2016-2017" && Actions[Action Type]="Call Center"))+0

Tag

  • RecordID (link to Records table)
  • Tag

Actions

  • RecordID
  • Action Type
  • Action Campaign ID
  • ...

There are 1 to many relationships from Records to Tag and Call tables.

 

If I output data from Records and Tag, I get the correct result.

If I also output the calculated field, I will get every combination of distinct tag for every record, not just the ones actually in the tag table for that record.

If I remove the calculated field, all back to normal.

 

 

Am I using the calculated field incorrectly?

 

Thanks,

William

1 ACCEPTED SOLUTION

Obviously something wrong with that Calculated column.

 

I've opted instead for doing a query method. Duplicated the actions table, filtered on the ones I want to count, did a group by, then a merge back into Records table.

 

Not so elagant, but returns the correct results and does not drive me insane!

 

Would love to get that Calculated column working properly though.

 

Thanks,

William

View solution in original post

6 REPLIES 6
Vvelarde
Community Champion
Community Champion

@williamdasilva

 

Hi, change the Cross Filter Direction from Single to BOTH

 

FilterCross.png




Lima - Peru

@Vvelarde

Thanks for the quick reply. Cross Filter to Both did not change anything. Below is what the relationships look like (Tag is actually called Assigned Appeals)

Screen Shot 2017-04-17 at 1.50.55 PM.png

 

 

Below is output from the Records table, filtered on one specific name. The column in blue is the calculated column.

Screen Shot 2017-04-17 at 1.51.27 PM.png

 

This is the Assinged appeal, filtered on the same record ID. 2 lines...

Screen Shot 2017-04-17 at 1.51.32 PM.png

 

When I add the calculated column from Records table, all of a sudden I get this!

Screen Shot 2017-04-17 at 1.51.38 PM.png

 

 

Thanks,

William

 

@williamdasilva

 

The inclusion of all the other values is generated by the +0 at the end of your formula.




Lima - Peru

@Vvelarde The +0 was there to avoid NULLS (or Blanks).

 

When I remove the +0, records that return NULL from the calculated field are excluded from the output!

 

Results without calcuated field

Screen Shot 2017-04-17 at 2.31.51 PM.png

 

results with calculated field (simply added the field)

Screen Shot 2017-04-17 at 2.32.12 PM.png

 

No filters...

Screen Shot 2017-04-17 at 2.33.04 PM.png

Obviously something wrong with that Calculated column.

 

I've opted instead for doing a query method. Duplicated the actions table, filtered on the ones I want to count, did a group by, then a merge back into Records table.

 

Not so elagant, but returns the correct results and does not drive me insane!

 

Would love to get that Calculated column working properly though.

 

Thanks,

William

Hi @williamdasilva,

I am very gald to hear that your issue got solved. Please mark your solution as answer, others will find workaround easily.

Thanks,

Angelia

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors