Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hola
Tengo una tabla (tabla1) que se parece a esto:
orderID | [artículo en el pedido] | [precio del artículo] |
1 | 1 | 100 |
2 | 1 | 300 |
3 | 1 | 200 |
1 | 2 | 350 |
2 | 2 | 50 |
1 | 3 | 150 |
3 | 2 | 200 |
4 | 1 | 700 |
Quiero crear una medida que resuma el precio de un pedido y luego tomar solo pedidos que tengan un valor superior a 500:
En mi ejemplo hay 2 pedidos con un precio sumado de más de 500. OrderID 1 tiene 600 y orderID 4 tiene 700
El resultado debería verse así:
Número de pedidos superiores a 500: 2
Lo probé con summerize y group by pero no logré hacerlo:
Número de pedidos superiores a 500 =
VAR Alpha = GROUPBY(Table1, [orderID],"TotalOrdersum",SUMX(currentgroup(),Table1[precio del artículo]))
VAR Beta= Countdistinct(Alpha [orderID]), Alpha[TotalOrdersum] > 500)
DEVOLUCIÓN
Beta
¿Por qué no funciona y cómo puedo hacerlo?
Gracias por su ayuda de antemano
Solved! Go to Solution.
Num orders > 500 =
var summaryTable = ADDCOLUMNS( VALUES('Table'[order ID]), "@amt", CALCULATE(SUM('Table'[price of item])) )
return COUNTROWS( FILTER( summaryTable, [@amt] > 500) )
Num orders > 500 =
var summaryTable = ADDCOLUMNS( VALUES('Table'[order ID]), "@amt", CALCULATE(SUM('Table'[price of item])) )
return COUNTROWS( FILTER( summaryTable, [@amt] > 500) )
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |