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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
rimbi
Helper I
Helper I

Calculo automatico de corrección de un valor según el menor valor de una comparativa

Hola, tengo 2 secciones de la empresa descompensadas, una tiene la capacidad de producir más que la otra, dependiendo de los operarios que tenga, ya que influye en las horas productivas.

Estoy intentando crear una corrección automática, cuando una de las dos seciones esta por debajo de producción de la otra y tengo que equilibrar reduciendo la que trabaja más para equipararla con la que trabaja menos.

Tengo estos datos:

rimbi_0-1747062874308.png

Quiero conseguir que:

VAR SeccionMenorCapacitacion =
        MIN([NReparacionesRealizablesDiariasChapa],[NReparacionesRealizablesDiariasPintura])

Según la sección menor hago los siguientes calculos:

VAR CorreccionReparacionesMenorCapacitador =
    SeccionMenorCapacitacion*[TotalDiasLaborablesAnuales]
    VAR CorrecionHorasFacturablesMenorCapacitadorChapa =
    CorreccionReparacionesMenorCapacitador * [Media HF Chapa]
    VAR CorrecionHorasFacturablesMenorCapacitadorPintura =
    CorreccionReparacionesMenorCapacitador * [Media HF Pintura]   
    RETURN   IF(CorreccionReparacionesMenorCapacitador,CorrecionHorasFacturablesMenorCapacitadorChapa,CorrecionHorasFacturablesMenorCapacitadorPintura)

 

¿Cómo consigo que según la menor sección calcule Chapa o Pintura?

 

Muchas gracias de antemano

 

1 ACCEPTED SOLUTION
v-venuppu
Community Support
Community Support

Hi @rimbi ,

Thank you for reaching out to Microsoft Fabric Community.

In order to get the smallest section to calculate Sheet Metal or Paint, please try with the below logic:

VAR SheetMetalProd = [NRadireMakeableSheetMetals]
VAR PaintProd = [NRaperdicalRepairsPaint]

-- Identify the Minor (less productive) Section
VAR MinorProduction = MIN(SheetMetalProd, PaintProd)

-- Calculate Base Correction Value
VAR CorrectionBase = MinorProduction * [TotalAnnualWorkingDays]

-- Calculate Correction for each section
VAR CorrectionSheetMetal = CorrectionBase * [MediumHFSheetMetal]
VAR CorrectionPaint = CorrectionBase * [MediumHFPaint]

-- Return the correct correction based on which section is minor
RETURN
IF(
SheetMetalProd < PaintProd,

CorrectionSheetMetal,

CorrectionPaint
)

  • We first store the production values of both sections.
  • We then determine which one is the minor section.
  • We calculate the base correction (based on workdays and then multiply by hourly factor).
  • Finally, we return the appropriate correction based on which section was lower.

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I'd truly appreciate it!

Thank you.

View solution in original post

3 REPLIES 3
rimbi
Helper I
Helper I

Muchas gracias @v-venuppu !

v-venuppu
Community Support
Community Support

Hi @rimbi ,

Thank you for reaching out to Microsoft Fabric Community.

In order to get the smallest section to calculate Sheet Metal or Paint, please try with the below logic:

VAR SheetMetalProd = [NRadireMakeableSheetMetals]
VAR PaintProd = [NRaperdicalRepairsPaint]

-- Identify the Minor (less productive) Section
VAR MinorProduction = MIN(SheetMetalProd, PaintProd)

-- Calculate Base Correction Value
VAR CorrectionBase = MinorProduction * [TotalAnnualWorkingDays]

-- Calculate Correction for each section
VAR CorrectionSheetMetal = CorrectionBase * [MediumHFSheetMetal]
VAR CorrectionPaint = CorrectionBase * [MediumHFPaint]

-- Return the correct correction based on which section is minor
RETURN
IF(
SheetMetalProd < PaintProd,

CorrectionSheetMetal,

CorrectionPaint
)

  • We first store the production values of both sections.
  • We then determine which one is the minor section.
  • We calculate the base correction (based on workdays and then multiply by hourly factor).
  • Finally, we return the appropriate correction based on which section was lower.

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I'd truly appreciate it!

Thank you.

Muchas gracias por ayudarme.

Si quisiera indicar a través de Texto que sección es la de Menor Produccion, como debería hacerlo?

Saludos

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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