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
nh27
Helper III
Helper III

Calculated column for distinct values

Bit of a challenging one I'm finding myself here, please see the attached image/table.

Capture.PNG

 

I have a Gross Value column but I actually need to calculate the GR Amount and IR Amount, the problem is the raw data duplicates Gross Value.

For GR Amount, Column HCT = E
For IR Amount, Column HCT = Q

Is there a way I can use DAX and is it smart enough to calculate the sum of GR Amount based on each 'Item' column?

So for above example the sum I'm actually looking to return for GR Amount is 19,882 and 17,212 for IR Amount.

Any ideas?

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@nh27 

It's better to create measures as follows, create the same for B as well

 

Gross Value E = 

CALCULATE(
	SUMX(
		SUMMARIZE(
			TABLE07,
			Table07[HCT],
			Table07[Gross Value]
		),
		Table07[Gross Value]
	),
	Table07[HCT] = "E"
)

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
nh27
Helper III
Helper III

Thank you both, I used your example @Fowmy  and it worked a treat

Fowmy
Super User
Super User

@nh27 

It's better to create measures as follows, create the same for B as well

 

Gross Value E = 

CALCULATE(
	SUMX(
		SUMMARIZE(
			TABLE07,
			Table07[HCT],
			Table07[Gross Value]
		),
		Table07[Gross Value]
	),
	Table07[HCT] = "E"
)

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Greg_Deckler
Community Champion
Community Champion

@nh27 Not sure I am 100% following but maybe something like this:

GR Amount Measure =
  VAR __Table = SUMMARIZE( FILTER( 'Table', [HCt] = "E" ), [Item], "__Gross", AVERAGE([Gross value]))
  VAR __Result = SUMX( __Table, [__Gross] )
RETURN
  __Result
  


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.