The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hola
He creado una segmentación de datos para introducir un valor mediante la creación de una tabla calculada:
Seq | Qty | Precio |
1 | 100 | 1000 |
2 | 250 | 1500 |
3 | 500 | 2000 |
4 | 1000 | 3000 |
Puede consultar la siguiente medida
Price = VAR A=SELECTEDVALUE(Quantity[Value])
var b=ADDCOLUMNS(ALLSELECTED('Rate'),"Divide",IF(a>[Qty],DIVIDE(a,[Qty]),DIVIDE([Qty],a)))
var c=SUMMARIZE(b,[Seq ],'Rate'[Qty],'Rate'[Price],[Divide],"Min",MINX(b,[Divide]))
return MINX(FILTER(c,[Min]=[Divide]),[Price])
QTY = VAR A=SELECTEDVALUE(Quantity[Value])
var b=ADDCOLUMNS(ALLSELECTED('Rate'),"Divide",IF(a>[Qty],DIVIDE(a,[Qty]),DIVIDE([Qty],a)))
var c=SUMMARIZE(b,[Seq ],'Rate'[Qty],'Rate'[Price],[Divide],"Min",MINX(b,[Divide]))
return MINX(FILTER(c,[Min]=[Divide]),[Qty])
Salida
¡Saludos!
Yolo Zhu
Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@PowerBi_Xandar , crear medidas como
Cantidad M =
var _max = mInx(filter(Table, [Qty]>= selectedvalue('Quantity Table'[value])), Table[Qty])
var _min = Maxx(filter(Table, [Qty]<= selectedvalue('Quantity Table'[value])), Table[Qty])
devolución
calculate(Sum(Table[Qty]), filter(Table, Table[Qty] =if(_max -[Qty]> [Qty] -_min , _min, _max)))
Precio M =
var _max = mInx(filter(Table, [Qty]>= selectedvalue('Quantity Table'[value])), Table[Qty])
var _min = Maxx(filter(Table, [Qty]<= selectedvalue('Quantity Table'[value])), Table[Qty])
devolución
calculate(Sum(Table[Price]), filter(Table, Table[Qty] =if(_max -[Qty]> [Qty] -_min , _min, _max)))
o usar uno de ellos un filtro de nivel visual
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.