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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
mluanastevens
Regular Visitor

Three columns names - sum the names every time the same name shows up

Hi I am new business Analyst and I cant seem to find the help for this question.

I basically have a large dataset with few columns named by diferent levels with one column with Cash. Like a Piramid type thing.

Capture.PNG

 

I basically need to have the total by column, knowing that:

1) Top person needs to sum all the specific column names ( like: Jessica Top person total should be $150, Vanessa should be $80,....) 2) 3Level totals should be the sum of the 2nd level +3level+ 1 level

3) 2nd level totals needs to be 2nd level+1level

 

I hope to find help for this. I am really excited for this project.

 

 

 

 

2 ACCEPTED SOLUTIONS

Hi, @mluanastevens ;

You could create a table as a name list. then create a measure.

1.create a table.

name = 
var _a=SUMMARIZE('Table',[Cas Name])
var _b=SUMMARIZE('Table',[GAName])
var _c=SUMMARIZE('Table',[MGAName])
var _d=SUMMARIZE('Table',[RGAName])
return DISTINCT( UNION(_a,_b,_c,_d))

2.create a measure.

MGA = IF(ISINSCOPE('name'[Name]),CALCULATE(SUM([ALP]),FILTER(ALLSELECTED('Table'),[MGAName]=MAX('name'[Name]))),SUM([ALP]))
RGA = IF(ISINSCOPE('name'[Name]),[MGA]+CALCULATE(SUM('Table'[ALP]),FILTER(ALLSELECTED('Table'),[RGAName]=MAX('name'[Name]))),[MGA]*2)

The final output is shown below:

vyalanwumsft_0-1638841688196.png

Best Regards,
Community Support Team_ Yalan Wu
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

v-yalanwu-msft
Community Support
Community Support

Hi, @mluanastevens ;

Try it.

MGA = IF(ISINSCOPE('name'[Name]),CALCULATE(SUM([ALP]),FILTER('Table',[MGAName]=MAX('name'[Name]))),SUM([ALP]))
MGA = IF(ISINSCOPE('name'[Name]),CALCULATE(SUM([ALP]),FILTER('Table',[MGAName]=MAX('name'[Name]))),SUM([ALP]))

vyalanwumsft_0-1638846037294.png

Best Regards,
Community Support Team_ Yalan Wu

View solution in original post

10 REPLIES 10
v-yalanwu-msft
Community Support
Community Support

Hi, @mluanastevens ;

Try it.

MGA = IF(ISINSCOPE('name'[Name]),CALCULATE(SUM([ALP]),FILTER('Table',[MGAName]=MAX('name'[Name]))),SUM([ALP]))
MGA = IF(ISINSCOPE('name'[Name]),CALCULATE(SUM([ALP]),FILTER('Table',[MGAName]=MAX('name'[Name]))),SUM([ALP]))

vyalanwumsft_0-1638846037294.png

Best Regards,
Community Support Team_ Yalan Wu

v-yalanwu-msft
Community Support
Community Support

Hi, @mluanastevens ;

Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
Community Support

Hi, @mluanastevens ;

You could create measures as follows:

Top per_sum = 
 CALCULATE(SUM([Cash]),FILTER(ALL('Table'),[Top Person]=MAX('Table'[Top Person])))
level2 = 
var _level1= CALCULATE(SUM([Cash]),FILTER(ALL('Table'),[1Level]=MAX('Table'[Top Person])))
var _level2= CALCULATE(SUM([Cash]),FILTER(ALL('Table'),[2nd Level]=MAX('Table'[Top Person])))
return _level1+_level2
level3 = 
var _level1= CALCULATE(SUM([Cash]),FILTER(ALL('Table'),[1Level]=MAX('Table'[Top Person])))
var _level2= CALCULATE(SUM([Cash]),FILTER(ALL('Table'),[2nd Level]=MAX('Table'[Top Person])))
return _level1+_level2+ CALCULATE(SUM([Cash]),FILTER(ALL('Table'),[3level]=MAX('Table'[Top Person])))

The final output is shown below:

vyalanwumsft_0-1638326174199.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, thank you so much for you help. I feel I am on the right track here, but can you help me why I keep getting the same totals for everybody?

 

mluanastevens_0-1638342736458.png

 

Hi, @mluanastevens ;

I'm really sorry that the details you gave me are too few,  so I can't judge the reason. If possible, could you share a simple file similar to your data? Or delete sensitive information and share it?
Best Regards,
Community Support Team_ Yalan Wu

Hi @v-yalanwu-msft Here is a snip of my data,

Cas NameALPSANameGANameMGANameRGANameTP
SHAWN GIRDHARI$300SHAHRIAR MOHAMMADI0AMIR SEDAGHATGUJRAL AGENCY LTDBob Gujral
WALIMUNIVIRAJ ABEYSEKERA$30000AMIR SEDAGHATGUJRAL AGENCY LTDBob Gujral
MOHINI LALL$117JILLIAN ARSHADI0GUJRAL AGENCY LTD0Bob Gujral
DEVIN JENKINS$61ROBERTO SAMANODIAZ0JACQUELINE KABLUYEN0Jackie Kabluyen
DEMETRIUS THOMASNULLTIFFANY ARNTZENVANVIPHA SUGAIKEVIN APPASAMY0Kevin Appasamy
DEMETRIUS THOMAS$1,147TIFFANY ARNTZENVANVIPHA SUGAIKEVIN APPASAMY0Kevin Appasamy

 

 

I usualy put it in pivot table so I can basically see the Top Person total, MGA total and RGA (which is MGA+RGA combined, I basically stack one on top of each other and re pivot to get the RGA total)

 

MGA and Top Person are easy to do on Power BI, i can just put them on filters, but the RGA (MGA+RGA) are the tricky part.I tried doing what you told me above and its not working, I keep getting the same numbers for everybody.

 

So basically MGA total will be:

Row LabelsSum of ALPGrand Total1925.16

AMIR SEDAGHAT600
GUJRAL AGENCY LTD117.48
JACQUELINE KABLUYEN60.6
KEVIN APPASAMY1147.08

 

RGA total will be :

 

01325.16
AMIR SEDAGHAT600
GUJRAL AGENCY LTD717.48
JACQUELINE KABLUYEN60.6
KEVIN APPASAMY1147.08

 

Do you think you can help be?

Hope it make sense. I really appreciate your help.  Thank you.

Hi, @mluanastevens ;

You could create a table as a name list. then create a measure.

1.create a table.

name = 
var _a=SUMMARIZE('Table',[Cas Name])
var _b=SUMMARIZE('Table',[GAName])
var _c=SUMMARIZE('Table',[MGAName])
var _d=SUMMARIZE('Table',[RGAName])
return DISTINCT( UNION(_a,_b,_c,_d))

2.create a measure.

MGA = IF(ISINSCOPE('name'[Name]),CALCULATE(SUM([ALP]),FILTER(ALLSELECTED('Table'),[MGAName]=MAX('name'[Name]))),SUM([ALP]))
RGA = IF(ISINSCOPE('name'[Name]),[MGA]+CALCULATE(SUM('Table'[ALP]),FILTER(ALLSELECTED('Table'),[RGAName]=MAX('name'[Name]))),[MGA]*2)

The final output is shown below:

vyalanwumsft_0-1638841688196.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I have weeks as filters as my data goes back till week 1 of 2021. When I have just one week selected the number is right, but when I select more than one week,  the numbers are wrong:

 

Here is a example. Do you know what can be causing this?

 

Capture1.PNGCapture2.PNG

ryan_mayu
Super User
Super User

@mluanastevens 

pls see the attachment and check if this is what you want.





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

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.