cancel
Showing results for
Did you mean:
Helper V

## Help With a Sumx Measure

Morning

I am working with a single table that has 'enrollment' numbers that I would like to sum up.  The trick is, each each territory/program has a distinct enrollment number.  I cannot simply sum up the enrollment column for the table has duplicate territory/program combinations.

I was trying to use the DAX formula 'Enrollment=sumx(Enrollment_tbl,enrollment).  This did not work as I expected.

I am attaching an image of data from an excel spreadsheet to better demonstrate what I am trying to achieve in BI.

TDR

1 ACCEPTED SOLUTION
Community Support

Hi @IamTDR ,

Take a try of this :

`Measure = SUMX(GROUPBY('BI BookInUse',[Program],[Territory],''BI BookInUse''[Enrollment]),[Enrollment])`

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
5 REPLIES 5
Community Champion

Hi @IamTDR

The below should work for you.

```Enrollment Measure =
SUMX(
GROUPBY( Enrollment_tbl, Enrollment_tbl[Territory], Enrollment_tbl[ProgCode] ),
[Enrollment]
)```

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.

Super User

@IamTDR try following

```Sum Enrollment =
SUMX(
SUMMARIZECOLUMNS( Table[Territory], Table[ProgCode]),
CALCULATE( SUM( Table[Enrollment] ) )
)```

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helper V

Thanks for the suggestions but so far I am not receiving the desired results.  I inserted an image of what my visual currently looks like.  The Total Enrollment number should total to 12,144 and not 60,720.  My Total Enrollment number is based on Territory and Program.

Measure currently being used.

Community Support

Hi @IamTDR ,

Take a try of this :

`Measure = SUMX(GROUPBY('BI BookInUse',[Program],[Territory],''BI BookInUse''[Enrollment]),[Enrollment])`

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Helper V

Thanks!  Appreicate the aid

TDR

Announcements

#### Launching new user group features

Learn how to create your own user groups today!