• Thanks again Happygeek

    So how would I add that to the query already running. I assume it isnt a simple copy and paste at the end of this?

    <SemanticQuery xmlns="http://schemas.microsoft.com/sqlserver/2004/10/semanticmodeling" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qd="http://schemas.microsoft.com/sqlserver/2004/11/semanticquerydesign" xmlns:rb="http://schemas.microsoft.com/sqlserver/2004/11/reportbuilder">
    <Hierarchies>
      <Hierarchy>
      <BaseEntity>
       <!--Split Bills-->
       <EntityID>G5df2da9f-e6f3-43a2-a6c8-d88c8857604d</EntityID>
      </BaseEntity>
      <Groupings>
       <Grouping Name="Bill Ref">
        <Expression Name="Bill Ref">
        <AttributeRef>
         <!--Bill Ref-->
         <AttributeID>G92133802-8b8a-425f-b185-3066817a2a74</AttributeID>
        </AttributeRef>
        </Expression>
       </Grouping>
       <Grouping Name="Bill Date">
        <Expression Name="Bill Date">
        <AttributeRef>
         <!--Bill Date-->
         <AttributeID>Gb4518022-6454-47d2-841c-f7008328a5fc</AttributeID>
        </AttributeRef>
        </Expression>
       </Grouping>
       <Grouping Name="Split Amount">
        <Expression Name="Split Amount">
        <AttributeRef>
         <!--Split Amount-->
         <AttributeID>G261cd954-8eac-4c36-b249-a932709239b7</AttributeID>
        </AttributeRef>
        </Expression>
       </Grouping>
       <Grouping Name="Fee Earner">
        <Expression Name="Fee Earner">
        <Path>
         <RolePathItem>
          <!--Fee Earner-->
          <RoleID>G3b9e5d1d-c168-43de-a834-db4d347834b6</RoleID>
         </RolePathItem>
        </Path>
        <EntityRef>
         <!--Fee Earner-->
         <EntityID>G71272ce9-9a2d-4d98-b4df-aabc29c9bf70</EntityID>
        </EntityRef>
        </Expression>
        <Details>
        <Expression Name="Fee Earner Reference">
         <AttributeRef>
          <!--Reference-->
          <AttributeID>Gd3a85ca0-53db-492f-8c3c-4ac769bd8896</AttributeID>
         </AttributeRef>
        </Expression>
        <Expression Name="Fee Earner Full Name">
         <AttributeRef>
          <!--Full Name-->
          <AttributeID>G17390b58-2537-4cc5-815b-608d0eec39ec</AttributeID>
         </AttributeRef>
        </Expression>
        </Details>
       </Grouping>
       <Grouping Name="Matter Ref">
        <Expression Name="Matter Ref">
        <Path>
         <RolePathItem>
          <!--Matter-->
          <RoleID>G788cd775-559a-4c6f-806f-9c5cf4a67251</RoleID>
         </RolePathItem>
        </Path>
        <AttributeRef>
         <!--Matter Ref-->
         <AttributeID>G7c418d9c-9193-4539-aac8-fee8f4772b4a</AttributeID>
        </AttributeRef>
        </Expression>
       </Grouping>
       <Grouping Name="Matter Description">
        <Expression Name="Matter Description">
        <Path>
         <RolePathItem>
          <!--Matter-->
          <RoleID>G788cd775-559a-4c6f-806f-9c5cf4a67251</RoleID>
         </RolePathItem>
        </Path>
        <AttributeRef>
         <!--Matter Description-->
         <AttributeID>G79aa13c4-ded3-4d3b-8bfe-4d0721853b45</AttributeID>
        </AttributeRef>
        </Expression>
       </Grouping>
       <Grouping Name="Fee Ref">
        <Expression Name="Fee Ref">
        <AttributeRef>
         <!--Fee Ref-->
         <AttributeID>G250dbd02-c28c-4ae5-9a3d-a94c38e2ff3c</AttributeID>
        </AttributeRef>
        </Expression>
       </Grouping>
       <Grouping Name="Fee Earner Reference1">
        <Expression Name="Fee Earner Reference1">
        <Path>
         <RolePathItem>
          <!--Matter-->
          <RoleID>G788cd775-559a-4c6f-806f-9c5cf4a67251</RoleID>
         </RolePathItem>
         <RolePathItem>
          <!--Fee Earner-->
          <RoleID>G5fe09b0b-806d-4823-a680-3c0fcb339a89</RoleID>
         </RolePathItem>
        </Path>
        <AttributeRef>
         <!--Reference-->
         <AttributeID>Gd3a85ca0-53db-492f-8c3c-4ac769bd8896</AttributeID>
        </AttributeRef>
        </Expression>
       </Grouping>
      </Groupings>
      <Filter>
       <Expression Name="filter">
        <Literal>
        <DataType>Boolean</DataType>
        <Value>true</Value>
        </Literal>
        <CustomProperties>
        <CustomProperty Name="qd:Filter" />
        <CustomProperty Name="qd:ContextEntityID">
         <Value xsi:type="xsd:string">G5df2da9f-e6f3-43a2-a6c8-d88c8857604d</Value>
        </CustomProperty>
        <CustomProperty Name="qd:AutoChangeBaseEntity" />
        <CustomProperty Name="qd:Design">
         <Value xsi:type="xsd:string">expr1</Value>
        </CustomProperty>
        </CustomProperties>
       </Expression>
      </Filter>
      </Hierarchy>
    </Hierarchies>
    <MeasureGroups>
      <MeasureGroup>
      <BaseEntity>
       <!--Split Bills-->
       <EntityID>G5df2da9f-e6f3-43a2-a6c8-d88c8857604d</EntityID>
      </BaseEntity>
      <Measures>
       <Expression Name="Total Client Balance">
        <Function>
        <FunctionName>Aggregate</FunctionName>
        <Arguments>
         <Expression>
          <Path>
          <RolePathItem>
           <!--Matter-->
           <RoleID>G788cd775-559a-4c6f-806f-9c5cf4a67251</RoleID>
          </RolePathItem>
          <RolePathItem>
           <!--Matter Financial Balances-->
           <RoleID>Ge216ebe0-3147-4bcf-8261-37b65da60cd3</RoleID>
          </RolePathItem>
          </Path>
          <AttributeRef>
          <!--Total Client Balance-->
          <AttributeID>Gedc5039d-d9a0-44ed-9102-9ef92fc69361</AttributeID>
          </AttributeRef>
         </Expression>
        </Arguments>
        </Function>
       </Expression>
       <Expression Name="Total Office Balance">
        <Function>
        <FunctionName>Aggregate</FunctionName>
        <Arguments>
         <Expression>
          <Path>
          <RolePathItem>
           <!--Matter-->
           <RoleID>G788cd775-559a-4c6f-806f-9c5cf4a67251</RoleID>
          </RolePathItem>
          <RolePathItem>
           <!--Matter Financial Balances-->
           <RoleID>Ge216ebe0-3147-4bcf-8261-37b65da60cd3</RoleID>
          </RolePathItem>
          </Path>
          <AttributeRef>
          <!--Total Office Balance-->
          <AttributeID>Gd55a38ed-3aa8-4f51-82f7-673933694f8c</AttributeID>
          </AttributeRef>
         </Expression>
        </Arguments>
        </Function>
       </Expression>
       <Expression Name="Total Deposit Balance">
        <Function>
        <FunctionName>Aggregate</FunctionName>
        <Arguments>
         <Expression>
          <Path>
          <RolePathItem>
           <!--Matter-->
           <RoleID>G788cd775-559a-4c6f-806f-9c5cf4a67251</RoleID>
          </RolePathItem>
          <RolePathItem>
           <!--Matter Financial Balances-->
           <RoleID>Ge216ebe0-3147-4bcf-8261-37b65da60cd3</RoleID>
          </RolePathItem>
          </Path>
          <AttributeRef>
          <!--Total Deposit Balance-->
          <AttributeID>Gc345d8ca-ded4-43f1-81af-9e3429f691bd</AttributeID>
          </AttributeRef>
         </Expression>
        </Arguments>
        </Function>
       </Expression>
       <Expression Name="Total Unbilled Disbs Balance">
        <Function>
        <FunctionName>Aggregate</FunctionName>
        <Arguments>
         <Expression>
          <Path>
          <RolePathItem>
           <!--Matter-->
           <RoleID>G788cd775-559a-4c6f-806f-9c5cf4a67251</RoleID>
          </RolePathItem>
          <RolePathItem>
           <!--Matter Financial Balances-->
           <RoleID>Ge216ebe0-3147-4bcf-8261-37b65da60cd3</RoleID>
          </RolePathItem>
          </Path>
          <AttributeRef>
          <!--Total Unbilled Disbs Balance-->
          <AttributeID>G62b48ba7-8995-4632-9ae3-ce52b0b323e3</AttributeID>
          </AttributeRef>
         </Expression>
        </Arguments>
        </Function>
       </Expression>
       <Expression Name="Bills Total Outstanding Amount">
        <Function>
        <FunctionName>Aggregate</FunctionName>
        <Arguments>
         <Expression>
          <Path>
          <RolePathItem>
           <!--Matter-->
           <RoleID>G788cd775-559a-4c6f-806f-9c5cf4a67251</RoleID>
          </RolePathItem>
          <RolePathItem>
           <!--Bills-->
           <RoleID>Gf4569edc-0402-4ed9-9765-cd1fb558584a</RoleID>
          </RolePathItem>
          </Path>
          <AttributeRef>
          <!--Total Outstanding Amount-->
          <AttributeID>G48e338c0-1df6-4259-b38a-6754d73e8b47</AttributeID>
          </AttributeRef>
         </Expression>
        </Arguments>
        </Function>
       </Expression>
      </Measures>
      </MeasureGroup>
    </MeasureGroups>
    </SemanticQuery>