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

Create a Measure to find the Plant Performance in Power BI Report

I have a manufacturing related column "Status" which has the values "Completed","Machine break","Maintenance",etc., I need to create a measure which gives the overall completed %.

 

If there are 10 rows and the Status field is "Completed" for around 7 rows,  then my measure should be 70%.

 

How to do this ? Please help

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try new measures like

 

Over all Completed % =
divide(calculate(countrows(Table), Table[Status] ="Completed"), calculate(countrows(Table)))

when you view by status
Status % = divide(calculate(countrows(Table)), calculate(countrows(Table), all(Table)))

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

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Try new measures like

 

Over all Completed % =
divide(calculate(countrows(Table), Table[Status] ="Completed"), calculate(countrows(Table)))

when you view by status
Status % = divide(calculate(countrows(Table)), calculate(countrows(Table), all(Table)))

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
Greg_Deckler
Community Champion
Community Champion

@Anonymous Sample data would make this easier. In theory:

 

Measure =
  VAR __Machine = MAX([Machine])
  VAR __Completed = COUNTROWS(FILTER(ALL('Table'),[Machine]=__Machine && [Status]="Completed"))
  VAR __All = COUNTROWS(FILTER(ALL('Table'),[Machine]=__Machine))
RETURN
  DIVIDE(__Completed,__All,0)

You might also be interested in MTBF - See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586.
The basic pattern is:
Column = 
  VAR __Current = [Value]
  VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])

  VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
  __Current - __Previous

 



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

Why we are using this field VAR __Machine = MAX([Machine]). What does this field contain ?

@Anonymous - That was for a measure to figure out what machine you are dealing with. Is this supposed to be a 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...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.

Top Kudoed Authors
Users online (191)