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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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