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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Philippe_Jamon
Helper II
Helper II

Problem calculating production rate

Hello everybody,

I have a problem with a dashboard I'm working on.

 

The data model is like that :

Philippe_Jamon_0-1711913194376.png

 

There are four dim tables (on top) and 3 fact tables above.

In the table "Rendement confection", I have sewing operations with date of the operation and ID of the employee (matricule).

I have the duration of each operation in the TempsGamme table.

 

Each employee can have a different amount of working time per day (the amount of time is in the Matricule table).

I made a calculated column in my fact table to get the amount of time :

MinutesMatricule = if(WEEKDAY(RendementConfection[Créé],2)<>5,LOOKUPVALUE(Matricule[TempsSemaine],Matricule[Matricule],RendementConfection[Matricule]),LOOKUPVALUE(Matricule[TempsVendredi],Matricule[Matricule],RendementConfection[Matricule])) 

 

I made another calculated columns to get break time of each employee :

TempsArretMatricule = LOOKUPVALUE(TempsArretConfection[TempsArret],TempsArretConfection[Matricule],RendementConfection[Matricule],TempsArretConfection[Date],RendementConfection[Créé]) 

 

I made another column to show the planned time (which is employee time minus breaks) :

MinutesOuvrées = RendementConfection[MinutesMatricule] - RendementConfection[TempsArretMatricule] 

 

I want to calculate the production rate of each employee per day, I made a calculated column for that :

Rendement = RendementConfection[Minutes produites] / RendementConfection[MinutesOuvrées] 

 

When i put the "Rendement" in a matrix, it works for each line but the grand total is false.

Philippe_Jamon_1-1711914216994.png

I also put the column in a graph and it only shows the grand total so it's not working as expected.

Philippe_Jamon_2-1711914285987.png

 

Thanks for your help.

 

Philippe J.

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Philippe,

 

My mistake, try the below. I just added Production[Date] to the SUMMARIZE function.

 

Production Rate (Measure) = 
VAR MinutesProduced = SUM ( Production[MinutesProduced] )
VAR MinutesOpen =
SUMX (
    SUMMARIZE ( Production, Production[EmployeeID], Production[Date], Production[Minutes opened] ),
    Production[Minutes opened]
)
VAR Result =
DIVIDE (
    MinutesProduced,
    MinutesOpen
)

RETURN Result

 

 

This is what mine looks like now:

Wilson__0-1712012377031.png


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

9 REPLIES 9
Wilson_
Super User
Super User

Hi Philippe,

 

First of all, this should not have been done through calculated columns. In addition, you didn't show the visual pane on your matrix or line chart but I'm guessing both visuals are simply summing up the calculated column, which explains the issue with the grand total.

 

Can you please share a sample pbix file? (If you don't know how, please check the pinned thread in the forum.) It will make it easier for me to re-write all the calculated columns as measures.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





@Wilson_ , Thanks for your answer.

I made a sample pbix and I tried to translate the name of each column so you can understand it easier.

 

Pbix sample 

 

I hope this would help.

Thanks for your help.

 

Philippe.

Hi Philippe,

 

Try this for your production rate measure:

 

Production Rate (Measure) = 
VAR MinutesProduced = SUM ( Production[MinutesProduced] )
VAR MinutesOpen =
SUMX (
    SUMMARIZE ( Production, Production[EmployeeID], Production[Minutes opened] ),
    Production[Minutes opened]
)
VAR Result =
DIVIDE (
    MinutesProduced,
    MinutesOpen
)

RETURN Result

 

 

Instead of adding the percentages together as you are currently doing (ie: dividing the minutes produced by the minutes opened for each employee, then summing), it adds up all the minutes produced and all the minutes opened for all the employees, before doing the division.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi again @Wilson_ ,

 

after checking the measure in the pbix file, it seems that it works partially.

The measure is working fine for each day, but it's not working for the total unfiltered and also not working if I select an employee.

 

It seems that the function that group the minutesopened for each employee doesn't take in consideration the day.

 

Philippe_Jamon_0-1711986178745.png

What i need to do is have one iteration of minutesopened per employee and per day (I don't know if it's understandable).

 

Thanks for your help.

 

Philippe.

 

 

Philippe,

 

My mistake, try the below. I just added Production[Date] to the SUMMARIZE function.

 

Production Rate (Measure) = 
VAR MinutesProduced = SUM ( Production[MinutesProduced] )
VAR MinutesOpen =
SUMX (
    SUMMARIZE ( Production, Production[EmployeeID], Production[Date], Production[Minutes opened] ),
    Production[Minutes opened]
)
VAR Result =
DIVIDE (
    MinutesProduced,
    MinutesOpen
)

RETURN Result

 

 

This is what mine looks like now:

Wilson__0-1712012377031.png


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks, it works perfectly now.

Have a nice day.

 

Philippe.

Awesome, thanks for letting me know. Happy to help, Philippe. 😄




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks for your solution @Wilson_ , it seems to work perfectly.

 

I have a question for my understanding. In my MinutesOpen column, i have the value of a workday, but a row just represent an action during this workday. How the measures doesn't add all the minutesopen (if it was the case, the result would be totally false.

 

Thanks again for your help and have a nice day.

Philippe,

 

The minutes open is not duplicated in my measure because the SUMMARIZE function I am using groups by the columns in the parameters (in this case, the employee, the date now, and the mninutes opened). You can read more about the function here.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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