cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NiugeS
Helper V
Helper V

Total of all child values

Hi all,

 

New to Power BI and struggling with something probably quite easy.  I have imported data from an excel as follows:

UserAmountGroup
A101
B121
C142
C122
B221
A2341
D242
D22
C7

1

 

But looing to create a chart visual as follows:

 

UserAmountGroupGroup Total
A101285
B121285
C14252
C12252
B221285
A2341285
D24252
D2252
C71285

 

Not sure what to search for but appreciate any help.


Thanks

1 ACCEPTED SOLUTION

OK, I literally spent 10 times longer looking for that post rather than just doing this:


Measure =
VAR __Group = MAX('Table'[Group])
RETURN
SUMX(FILTER(ALL('Table'),'Table'[Group] = __Group),'Table'[Amount])

 

PBIX is attached. Sorry, next time instead of trying to refer you to a similar issue, I'll just solve the thing! 🙂  PBIX is attached below.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
v-xuding-msft
Community Support
Community Support

Hi @NiugeS ,

Please try this:

Measure = 
CALCULATE (
    SUM ( 'Table'[Amount] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Group] = MAX ( 'Table'[Group] ) )
)

If you also need to show the total value, please try this:

Total Measure = SUMX('Table',[Measure])

 4.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User IV
Super User IV

Huh, I literally just answered a very similar question. See if this thread helps, last post of mine:
https://community.powerbi.com/t5/Desktop/how-to-check-for-ID-s-with-change-in-status-category-from-l...

---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks - just downloaded the pbix file from the other post and trying to work it out.  Thanks.

Sure, @NiugeS let me know if you need further assistance but figured that was the fastest way to help out.

---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks @Greg_Deckler  - i can't say I follow .. sorry, new to Dax but trying to figure it out.  Not sure if negative numbers are causing issues either but will try and figrue it out.. thank you

OK, I literally spent 10 times longer looking for that post rather than just doing this:


Measure =
VAR __Group = MAX('Table'[Group])
RETURN
SUMX(FILTER(ALL('Table'),'Table'[Group] = __Group),'Table'[Amount])

 

PBIX is attached. Sorry, next time instead of trying to refer you to a similar issue, I'll just solve the thing! 🙂  PBIX is attached below.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Well first, it would help if I sent you to the correct thread: https://community.powerbi.com/t5/Desktop/Use-slicer-to-filter-by-another-column/m-p/1025543

Hang tight, I'll try to whip up a PBIX for you.

---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors