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.
¡Hola a todos!
Por favor, ayúdame con el cálculo de medida de %.
Tengo datos como este:
cantidad de producto fecha lo que deseo hacer (como en Excel) - %%
2020/04/21 manzanas 30 30/900
2020/04/21 huevos 15 15/900
Harina 2020/04/21 900 900/900
2020/04/21 canela 20 20/900
Y necesito encontrar el porcentaje de todo el producto a la harina.
Hola @sadwick ,
Pruebe esta medida:
Tal vez algo como:
Measure =
VAR __Amount = MAX('Table'[amount])
VAR __Flour = MAXX(FILTER('Table',[product] = "flour"),[amount])
RETURN
DIVIDE(__Amount,__Flour)
@Greg_Deckler gracias!
Pero si esta tabla es acumulativa. ¿Y necesito un porcentaje de todo el producto a la harina donde la fecha -fecha máxima?
cantidad de producto fecha lo que deseo hacer (como en Excel) - %%
2020/04/21 manzanas 30
2020/04/21 huevos 15
Harina 2020/04/21 900
2020/04/21 canela 20
2020/04/22 manzanas 60 60/400
2020/04/22 huevos 9 9/400
Harina 2020/04/22 400 900/400
2020/04/22 canela 60 60/400
Hola @sadwick ,
Prueba esto:
Measure =
VAR __Date =
MAXX ( ALLSELECTED ( 'Table' ), 'Table'[date] )
VAR __Amount =
CALCULATE (
MAX ( 'Table'[Amount] ),
FILTER ( ALLEXCEPT ( 'Table', 'Table'[Product] ), 'Table'[Date] = __Date )
)
VAR __Flour =
MAXX (
FILTER ( ALLSELECTED ( 'Table' ), [product] = "flour" && [date] = __Date ),
[amount]
)
RETURN
IF ( MAX ( 'Table'[Date] ) = __Date, DIVIDE ( __Amount, __Flour ) )
Saludos
Icey
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
OK, así que basado en esta medida rápida: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814
Eso sería algo así como:
Measure =
VAR __Date = MAX('Table'[date])
VAR __Product = MAX('Table'[product]) //assumes product is in the visualization
VAR __Amount = MAXX(FILTER('Table',[product] = __Product && [date] = __Date),[amount])
VAR __Flour = MAXX(FILTER('Table',[product] = "flour" && [date] = __Date),[amount])
RETURN
DIVIDE(__Amount,__Flour)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |