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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.