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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
o59393
Post Prodigy
Post Prodigy

Cómo obtener el valor máximo y su capacidad

Hola a todos

Estoy tratando de obtener en una medida el valor de la capacidad donde su demanda es el máx.

En el ejemplo siguiente, el valor que debe devolver la medida debe ser el de diciembre (857.793) ya que la demanda máxima es en diciembre.

dsfdsdsfd.JPG

¿Cómo puedo obtener el valor de la capacidad que cumple la condición anterior?

Ya tengo la demanda:

Max demand = MAXX(VALUES('Master Table Month'[Month]),[% of sales by line what if rolling])

https://1drv.ms/u/s!ApgeWwGTKtFdhyEaO7IZgUhf2Q-l?e=7mruzM

Gracias a todos.

1 ACCEPTED SOLUTION

Hola @o59393 ,

Puede crear una medida como se indica a continuación:

_maxCapacity =
VAR _maxMonth =
    CALCULATE (
        MAX ( 'Append1 % of total country demand produced in line'[Month] ),
        FILTER (
            ALL ( 'Append1 % of total country demand produced in line' ),
            [% of sales by line what if rolling] = [Max demand]
        )
    )
RETURN
    CALCULATE (
        [Capacity Measure],
        FILTER (
            ALL ( 'Append1 Balance your lines'[Append1 % of total country demand produced in line.Month] ),
            'Append1 Balance your lines'[Append1 % of total country demand produced in line.Month] = _maxMonth
        )
    )

the max value and its capacity.JPG

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@o59393 , Probar como

Máx.-
var _max -calculate(maxx(values(Table[Month]),[demand UC]),allexcept(Table[Month]))
devolución
calculate([demand UC], filter(Table, Table[Month] ?_max))

Hola @amitchandak

Nos estamos acercando, supongo que entiendo la lógica.

el var _max es para devolver el mes cuya demanda tiene un máximo. En este caso debe conservar "diciembre"

La devolución debe calcular la capacidad (en este caso se llama "medida de capacidad") cuando el mes coincide con el var max: december para este ejemplo.

Intenté esto:

Max = 
var _max =calculate(maxx(values('Append1 Balance your lines'[Month]),[% of sales by line what if rolling]))
return
calculate([Capacity Measure], filter('Append1 Balance your lines', 'Append1 Balance your lines'[Month] =_max))

Estoy obteniendo un resultado vacío. ¿Puede por favor aconsejar cómo solucionarlo?

¡Gracias!

Hola @o59393 ,

Puede crear una medida como se indica a continuación:

_maxCapacity =
VAR _maxMonth =
    CALCULATE (
        MAX ( 'Append1 % of total country demand produced in line'[Month] ),
        FILTER (
            ALL ( 'Append1 % of total country demand produced in line' ),
            [% of sales by line what if rolling] = [Max demand]
        )
    )
RETURN
    CALCULATE (
        [Capacity Measure],
        FILTER (
            ALL ( 'Append1 Balance your lines'[Append1 % of total country demand produced in line.Month] ),
            'Append1 Balance your lines'[Append1 % of total country demand produced in line.Month] = _maxMonth
        )
    )

the max value and its capacity.JPG

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@yingyinr ¡Impresionante!

Gracias 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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