Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Estimados, buenos días, necesito ayuda con un cálculo para el area de mantenimiento.
Por un lado tengo esta tabla donde mes a mes voy completando el tiempo de operacion necesario de distintas plantas.
Mes | Planta 1 | Planta 2 | Planta 3 | Planta n.. |
Enero | 10 Hs | 11 Hs | 9 Hs | 14 Hs |
Febrero | 12 Hs | 13 Hs | 12 Hs | 10 Hs |
Noviembre | 13 Hs | 15 Hs | 8 Hs | 13 Hs |
Diciembre | 14 Hs | 17 Hs | 5 Hs | 14 Hs |
Por otro lado, tengo una tabla donde descargo los tiempos fuera de servicio de cada equipo que forman parte de cada planta:
Aviso | Equipo | Planta | Fecha | Tiempo fuera de servicio(en Horas) |
1 | 1 | Planta 1 | 01/01/2022 | 4 |
2 | 2 | Planta 1 | 01/01/2022 | 2 |
3 | 3 | Planta 2 | 01/02/2022 | 150 |
4 | 4 | Planta 3 | 01/12/2022 | 10 |
Lo que necesito es sacar el % de tiempo disponible de cada equipo realizando la operacion ((Tiempo necesario Enero Planta 1 - Tiempo fuera de servicio Equipo Planta 1)/ Tiempo necesario Enero Planta 1)
En el ejemplo 1 sería ((10-4)/10).
Esto tengo que hacerlo para cada equipo en cada mes del año para poder publicar una tabla con todos aquellos cuyo % disponibilidad sea menor a 90%.
Me podrían ayudar a poder resolverlo? Muchas gracias!
Solved! Go to Solution.
Hi @shompy08 ,
According to your description, here's my solution.
1.In Power Query, select all Floor columns at the same time(Ctrl+select).
2.Click Unpivot Columns tab under Transform ribbon.
3.Then select Extract Text Before Delimiter, enter a space in the Delimiter box.
Get this table.
4.In another table2, create a calculated column Month.
Month = FORMAT('Table2'[Date],"MMMM")
5.Create a measure.
% availability =
VAR _TimeNeeded =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[Month] = MAX ( 'Table2'[Month] )
&& 'Table'[Plant] = MAX ( 'Table2'[Plant] )
),
'Table'[Hours]
)
RETURN
DIVIDE (
_TimeNeeded - MAX ( 'Table2'[Time out of service (in Hours)] ),
_TimeNeeded
)
Get the result. You can apply the visual filter to get % avaliability less than 90%.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @shompy08 ,
Yes, you can modify the formula like this:
% availability =
VAR _TimeNeeded =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[Month] = MAX ( 'Table2'[Month] )
&& 'Table'[Plant] = MAX ( 'Table2'[Plant] )
),
'Table'[Hours]
)
VAR _DIVIDE =
DIVIDE (
_TimeNeeded - MAX ( 'Table2'[Time out of service (in Hours)] ),
_TimeNeeded
)
RETURN
IF ( _DIVIDE < 0, 0_DIVIDE )
Best Regards,
Community Support Team _ kalyj
Did you understand my question?
Hi @shompy08 ,
Sorry I'm not very clear about your problem, are you convenient to share your pbix file without sensitive information here?
Best Regards,
Community Support Team _ kalyj
I created a new file with some of the data. There is the .pbix.
In the page 1 (calculated) is how is now. In the page 2 (ideal) is what i need. Not just include the equipment that had a notifications (p1), if some equipment didn't have a notification it's understood that it had a 100% of availability in the month and i need to show them in the list. Example.pbix
Hi @shompy08 ,
I modify the formula like this:
Cálculo disponibilidad =
VAR _TimeNeeded =
MAXX (
FILTER (
ALL ( 'Tiempo de necesidad' ),
'Tiempo de necesidad'[Mes] = MAX ( Notifications[Mes parada])
&& 'Tiempo de necesidad'[Planta] = MAX ( Notifications[Planta] )
),
'Tiempo de necesidad'[Valor]
)
VAR _DIVIDE =
DIVIDE (
_TimeNeeded - MAX ( Notifications[Duración parada] ),
_TimeNeeded
)
RETURN
IF ( _DIVIDE < 0, 0,IF(_TimeNeeded=BLANK(),1,_DIVIDE))
I attach the sample below for reference.
Best Regards,
Kaly
Kaly, thanks for your help, you are very kind!
There is some mistake because the list is showing incorrect information. If you see in the example that you attached, every "Equipo" is repeated three times, one for every plant, which is incorrect.
If i want to show my boss a list of the "Equipos" for every plant and its calculate, it show all the equipments! I suppose this happen to with the dates by month.
And if you see the data, the code 3001045 belongs to "Toyota Hilux..." not to "Bomba Allweiler" as in the picture you can see.
Did i explain the error?
Thanks again for all you help!
Hi @shompy08 ,
I'm clear, for the current report, the problem can be solved by selecting the Planta column in the Notifications table, not in the Plants-Locations table.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
Dear Kaly, im affraid that is not correct!
If you see in the img and in the report, there are some equipments from another plants showed when the filter CVSA is activated.
Even, if you select another plant, the information showed in the table is the same, not change.
did i explain what i'm seeing?
Regards!
Hi @shompy08 ,
Yes, the measure always can't be filtered by the slicer, I think it's because the formula " IF(_TimeNeeded=BLANK(),1", it makes all options have a value always. In order to make blank lines return 1, I use other formulas, but can't be filtered by the slicer also. Without this condition, everything works fine.
Best Regards,
Community Support Team _ kalyj
Ok, thanks very much Kaly. I guess i will need to duplicate the table just for show the "NO OK" values and kepp one to all the values.!
Greetings!
Dear, i have a little problem with the report.
When i publish in a table, i can't see all the equipments asociated with each plant. I suppose this happen because this equipment doesn't had a breakdown report (table 2) in the month but its works all the time that the plant need. (Hours needed)
If the equipment doesn't have a a report it has to appear in the table with 100% availability. Do you know how i can see this?
Here is an a example, in the left, the table has the formula for equipments of "PETN" plant that you show me, in the right, part of the full list of equipment for the "PETN" plant.
Did explain my problem? I need that the table showme the full list with the %, 100% if there was not breakdowns, and n% if the equipment had a breakdown in the month.
Thx in advance!
Thx! you saved me! i made some small modifications cause the idea was different but it works!
There is any way to make negative values in 0? i mean, if the result is -75,2 % For ex, can use something to indicate just 0 in the formula?
Hi @shompy08 ,
Yes, you can modify the formula like this:
% availability =
VAR _TimeNeeded =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[Month] = MAX ( 'Table2'[Month] )
&& 'Table'[Plant] = MAX ( 'Table2'[Plant] )
),
'Table'[Hours]
)
VAR _DIVIDE =
DIVIDE (
_TimeNeeded - MAX ( 'Table2'[Time out of service (in Hours)] ),
_TimeNeeded
)
RETURN
IF ( _DIVIDE < 0, 0_DIVIDE )
Best Regards,
Community Support Team _ kalyj
Hi @shompy08 ,
According to your description, here's my solution.
1.In Power Query, select all Floor columns at the same time(Ctrl+select).
2.Click Unpivot Columns tab under Transform ribbon.
3.Then select Extract Text Before Delimiter, enter a space in the Delimiter box.
Get this table.
4.In another table2, create a calculated column Month.
Month = FORMAT('Table2'[Date],"MMMM")
5.Create a measure.
% availability =
VAR _TimeNeeded =
MAXX (
FILTER (
ALL ( 'Table' ),
'Table'[Month] = MAX ( 'Table2'[Month] )
&& 'Table'[Plant] = MAX ( 'Table2'[Plant] )
),
'Table'[Hours]
)
RETURN
DIVIDE (
_TimeNeeded - MAX ( 'Table2'[Time out of service (in Hours)] ),
_TimeNeeded
)
Get the result. You can apply the visual filter to get % avaliability less than 90%.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
119 | |
78 | |
58 | |
52 | |
46 |
User | Count |
---|---|
170 | |
117 | |
63 | |
58 | |
51 |