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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.