Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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