Forum Discussion
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
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
6 Replies
- VvelardeCommunity Champion
- williamdasilvaRegular Visitor
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)
Below is output from the Records table, filtered on one specific name. The column in blue is the calculated column.
This is the Assinged appeal, filtered on the same record ID. 2 lines...
When I add the calculated column from Records table, all of a sudden I get this!
Thanks,
William
- VvelardeCommunity Champion
The inclusion of all the other values is generated by the +0 at the end of your formula.