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

Sumx Total Measure

Hi ,

 

I have below dataset

 

KPIActual Value     Program     Region
Material    80       ASouth
Material     70       BSouth
Material     70       CSouth
Number of Sites      1       ASouth
Number of Sites      2       BSouth
Number of Sites      3       CSouth

 

Total Sites =  Σ Material* Number of Sites =SUM(80*1+70*2+70*3)

 

 I want to create Total Sites Measure, not by calculated columns

 

Thanks

 

 

 

 

 

1 ACCEPTED SOLUTION
DataZoe
Microsoft Employee
Microsoft Employee

@Anonymous I beleive this is the measure you want:

 

Total Sites = 
sumx(values('Table'[Program]),
CALCULATE(sum('Table'[Actual Value]),'Table'[KPI]="Material")
* CALCULATE(sum('Table'[Actual Value]),'Table'[KPI]="Number of Sites"))

 

 totalsites.JPG

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

7 REPLIES 7
DataZoe
Microsoft Employee
Microsoft Employee

@Anonymous I beleive this is the measure you want:

 

Total Sites = 
sumx(values('Table'[Program]),
CALCULATE(sum('Table'[Actual Value]),'Table'[KPI]="Material")
* CALCULATE(sum('Table'[Actual Value]),'Table'[KPI]="Number of Sites"))

 

 totalsites.JPG

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Anonymous
Not applicable

Correct. I m looking for this one

Greg_Deckler
Community Champion
Community Champion

@Anonymous - Seems like:

Measure =
  VAR __Table = 
    ADDCOLUMNS(
      SUMMARIZE('Table',[Region],[Program],"Value",SUMX(FILTER('Table',[KPI]="Material"),[Actual Value]),"Number",SUMX(FILTER('Table',[KPI]="Number of Sites"),[Actual Value])),
      "Product",[Value] * [Number]
    )
RETURN
  SUMX(__Table,[Product])

But, I get the feeling that you shouldn't have unpivoted your KPI column...



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...
amitchandak
Super User
Super User

@Anonymous , pivot this data and try

https://radacad.com/pivot-and-unpivot-with-power-bi
https://youtu.be/oKByyI09Bno

 

then you can multiple

 

Or try a measure like

sumx(summarize(Table, Table[Program],Table[Region], "_1", calculate(sum(Table[Actual Value]), Table[KPI] ="Material" ) * calculate(sum(Table[Actual Value]), Table[KPI] ="Number of Sites" )),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

My requirement is to do without Pivot data.Is there any method do without pivoting?

@Anonymous , try a measure like

sumx(summarize(Table, Table[Program],Table[Region], "_1", calculate(sum(Table[Actual Value]), Table[KPI] ="Material" ) * calculate(sum(Table[Actual Value]), Table[KPI] ="Number of Sites" )),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

image.png

getting this error

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.