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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Measure that divides two filtered columns

Hello all,

 

I'm running into an issue where my calculated values are not showing the value I want. See table below for an example of a Project with 3 Work Orders. Each WO has a set number of locations to be completed.

 

ProjectWork TypeWork OrderCompletedNot StartedIn ProgressTotal Construction Locations
Western 25GR OH123456830083
Western 25GA Feeder2345670808
Western 25GA Lateral345678034034


I'm trying to look at the Project as a whole and find the % of completed locations. I would like for it to calculate 83 Completed/125 Total Locations = .664 or 66.4%. However, when I created a column using the formula below, it just gave me 3 rows of 25.04%, which summed to 75.1% (below). 

 

 

% of Completed = sum('S123 WOs'[Completed Locations by WO])/sum('S123 WOs'[Total Construction Locations])

 

 

Western 25.PNG

 

Can someone help me write the correct formula for a measure to give me 83/125 = .66.4% instead of 75.1%? Keep in mind that the table also contains other Projects, though I listed just one example. Thanks. 

 

Robyn

1 ACCEPTED SOLUTION

@Anonymous Missed a paren

% of Completed = sum('S123 WOs'[Completed Locations by WO])/CALCULATE(sum('S123 WOs'[Total Construction Locations]),ALL('S123 WOs'[Total Construction Locations]))

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Anonymous 

I think:

% of Completed = sum('S123 WOs'[Completed Locations by WO])/CALCULATE(sum('S123 WOs'[Total Construction Locations],ALL('S123 WOs'[Total Construction Locations]))

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler ,

 

I am getting an error for "Too many arguments were passed to the SUM function. The maximum argument count for the function is 1." 

 

☹️

 

Robyn

@Anonymous Missed a paren

% of Completed = sum('S123 WOs'[Completed Locations by WO])/CALCULATE(sum('S123 WOs'[Total Construction Locations]),ALL('S123 WOs'[Total Construction Locations]))

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Perfect. This worked! I've been going in circles trying to figure it out, but I was missing the ALL function. 

 

Thank you so much! #lifesaver

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.