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
Anonymous
Not applicable

Aggregate based on only 1 column instead of 2 columns

Hi Guys,

I have a requirement wherein I have 3 columns Group, SubGroup, Volume(Measure). Group has 2 values (A, B) and SubGroup A has 3 values (x,y,z) and subgroup B has 1 value x, and also there is a column Volume(Sum) based on each field in a table. I want to get an Output where we are able to display all three columns but the volume is aggregated based on only Group Column and does not calculate Volume(Sum) based on  Subroup Column. Is there any way we can achieve this?. Please find the example image below.

 

SatwikHegde_0-1607676031817.png

 

Any help would be highly appreciated.

Thanks in Advance

 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Instead of using your subgroup column, you could just use a measure instead.  You can then just show a simple sum of your volume column.

 

SubGroup Measure = var vSubGroups = VALUES(Table[SubGroup])

Return IF(COUNTROWS(vSubgroups)=1, vSubGroups, " ")  //returns a space instead of BLANK() so it shows

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

Instead of using your subgroup column, you could just use a measure instead.  You can then just show a simple sum of your volume column.

 

SubGroup Measure = var vSubGroups = VALUES(Table[SubGroup])

Return IF(COUNTROWS(vSubgroups)=1, vSubGroups, " ")  //returns a space instead of BLANK() so it shows

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Yes, Even this works, Thanks a lot for the Idea.

 

Thanks,

Sathwik

lbendlin
Super User
Super User

Have you tried not including the subgroup in your table or matrix visual? Or does your expected output really need to show the name of the single subgroup or blank if there is more than one subgroup?

Anonymous
Not applicable

Hi @lbendlin ,
I have created a custom column, in which I have renamed all the subgroups(x,y,z) = "" of Group A. So now instead of considering 3 different subgroups, the table will display it as one subgroup. This way my both goals of displaying blank in the subgroup column for that particular group (A) and aggregating it as one group only can be achieved.

Thanks

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.