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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
elcapitano
Regular Visitor

Aggregating fields but applying total at a specific dimension

Hi folks,

 

I am hoping this is a simple question and its a bit of a funky problem to solve that I've not come across in Power BI. Basically if you imagine we have a dataset which produces Field column (with values A, B, C) and Measure 1 and we want to do something where a new measure (Measure 2) is an aggregate of the everything in Measure 1 but when we display it we only want it to sit at the field A and to ignore B and C

 

Is this sort of thing possible?

 

Field Measure 1Measure 2
A1017
B5 
C2 

 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You can try an expression like this.

 

Measure2 =
VAR M1sumx =
SUMX ( ALLSELECTED ( Table[Field] ), [Measure 1] )
RETURN
IF ( MIN ( Table[Field] ) = "A", M1sumx )

 

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

3 REPLIES 3
elcapitano
Regular Visitor

Thanks for the suggestions - both great. But I think I'll need to elaborate on the situtation a bit more as this piece works for a simple problem but I have something that's a bit more complicated so will create a follow up problem for it. Will create a PBIX file for it too

vojtechsima
Super User
Super User

Hi, @elcapitano,
I am not sure it's the best approach to create a calculated column for this, I would probably just create a measure to specific visual, however, if you want to have a physical table like you showed, you can use something like this:

Measure 2 = 
var summarizeEverything = sum('Table'[Measure 1])
var FieldCheck = "A"

var CheckCondition = if('Table'[Field] = FieldCheck, summarizeEverything)

return CheckCondition

 

vojtechsima_0-1646138961507.png

If you want a more specific formula, please share the actual dataset.






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.
mahoneypat
Microsoft Employee
Microsoft Employee

You can try an expression like this.

 

Measure2 =
VAR M1sumx =
SUMX ( ALLSELECTED ( Table[Field] ), [Measure 1] )
RETURN
IF ( MIN ( Table[Field] ) = "A", M1sumx )

 

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


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.