cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dpibarker
Frequent Visitor

Using SumX like sumifs and getting totals sums

I have a data table with locations, area # and other measured data. 

Example:

LocationAreaMeasure
Location A1BK353079.809
Location A1BK352814.287
Location A1GI403743.701
Location A1GI403544.88
Location A1NL503449.787
Location A1PL503445.053
Location A1PL503435.71
Location A1PL503160.638
Location A1SW403153.577
Location B2BC713127.085
Location B2BH403063.513
Location B2BH403061.719
Location B2BH403043.09
Location B2BL402997.417
Location B2HG602936.687
Location B2HG602898.549
Location C3BC402868.828
Location C3BH502820.418
Location C3BH502651.894
Location C3BH502415.948
Location C3MU453537.022

I need to get the

1. Total Sum by Location

2. Total Sum by Location and Area

3. Percent: SumbyLocationArea / SumbyLocation

 

Summarized in Excel, this would be:

Total by Location   Total by Location & Area Calculation 
29827.44 Location A1BK355894.09619.76%
  Location A1GI407288.5824.44%
  Location A1NL503449.78711.57%
  Location A1PL5010041.433.66%
  Location A1SW403153.57710.57%
21128.06 Location B2BC713127.08510.48%
  Location B2BH409168.32230.74%
  Location B2BL402997.41710.05%
  Location B2HG605835.23519.56%
14294.11 Location C3BC402868.8289.62%
  Location C3BH507888.2626.45%
  Location C3MU453537.02211.86%

 

1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

Your output seems to be wrong in the percentage column ...

Sum per Location = CALCULATE( sum(Table1[Measure]) , ALLEXCEPT(Table1, Table1[Location]))
% within Location = sum(Table1[Measure])
/ CALCULATE( sum(Table1[Measure]) , ALLEXCEPT(Table1, Table1[Location]))

 

sevenhills_0-1669842133934.png

 

View solution in original post

1 REPLY 1
sevenhills
Super User
Super User

Your output seems to be wrong in the percentage column ...

Sum per Location = CALCULATE( sum(Table1[Measure]) , ALLEXCEPT(Table1, Table1[Location]))
% within Location = sum(Table1[Measure])
/ CALCULATE( sum(Table1[Measure]) , ALLEXCEPT(Table1, Table1[Location]))

 

sevenhills_0-1669842133934.png

 

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.