Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
IamTDR
Responsive Resident
Responsive Resident

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.

Thanks in advance.

TDR

Capture.JPG

1 ACCEPTED SOLUTION

Hi @IamTDR ,

 

Take a try of this :

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

6.PNG

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.

View solution in original post

5 REPLIES 5
Mariusz
Community Champion
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.
Mariusz Repczynski



parry2k
Super User
Super User

@IamTDR try following 

 

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


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

IamTDR
Responsive Resident
Responsive Resident

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.

 

 

Capture.JPG

 

Measure currently being used.

Capture2.JPG

Hi @IamTDR ,

 

Take a try of this :

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

6.PNG

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.

Thanks!  Appreicate the aid

TDR

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.