Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Average Value Unaffected By Filters

Hi everyone I'm struggling with something I know should be relatively straightforward. I have three tables: Regions (one side) related to Locations(many side). And Locations (one side) related to A...
  • Anonymous's avatar
    Anonymous
    2 years ago

    So after much head scratching I got this working by making the relationship between the Regions and Location tables bidirectional.  The following code then worked:

     

    Avg Audit Score - Regions =
     CALCULATE(
        [Avg Audit Score],
        REMOVEFILTERS(Locations),
        VALUES(Regions))
     
    I now get the regional average for each location associated with a particular region, with the total for all regions equal to the the company group average.  The values can still be filtered by columns in the Audits table, which is the desired outcome.
     
    I'm not sure if there is still a better way to code this without resorting to making the relationship bidirectional?