Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Group rows with same and different values.

Hi, I am trying to group/summarize rows with the same values. The problem is some of rows are a match for 2/3 of the columns which screws up my data. 

 

Example: 

Before query is executed

 

EmailDept NumberCost
[email protected]56562.00
[email protected]12126.00
[email protected]56563.00
[email protected]56562.00

 

After query is executed

EmailDept NumberCost
[email protected]56564.00
[email protected]12126.00
[email protected]56563.00

 

I need the similar rows with different cost to be rolled up as well. I am using a simple summarize query to achieve this but how can I get the rows with different cost to be grouped in as well?

 

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      That worked ! One more thing though im trying to add a date filter but Im getting an error that "," before cost is incorrect. Any Idea why? 

       

      DEFINE VAR MAveragePrice =
      ADDCOLUMNS (
      CALCULATETABLE (
      SUMMARIZE ( 'Usage details amortized',
      'Usage details amortized'[Tags - copy.DepartmentNumber],
      'Usage details amortized'[Tags - copy.OwnerEmail]),
      Usage details amortized'[Date])>= DATE ( 2022, 12, 01 ) &&
      'Usage details amortized'[Date] <= DATE ( 2022, 12, 31 )
      ),
      "Cost",
      CALCULATE(SUM('Usage details amortized'[Cost])),
      )
      EVALUATE
      MAveragePrice

      • FreemanZ's avatar
        FreemanZ
        Super User

        hi Anonymous 

        CALCULATETABLE seems unnecessary, or?

         

        p.s. please consider @someone, to continue a discussion.