The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
A situação é a seguinte: tenho uma ordem de pedido para entregar até um determinado dia, porém esse pedido pode ser entregue por partes em vários dias. Preciso de uma função que me indique a % que foi entregue até a data limite. no exemplo a cima seria a soma da porcentagem entregue no dia 17 e no dia 20, desconsiderando-se a parte entregue no dia 27.
[Dt. saída esperada] e [qt. entrada] vem da mesma planilha "entradas", todas as demais vem da planilha "saidas"
Solved! Go to Solution.
Hi @acbi ,
Try this code.
Running Total Percentage =
VAR _Deadline =
CALCULATE ( MAX ( Outputs[Date] ), ALLEXCEPT ( Outputs, Outputs[OP + REF] ) )
VAR _RUNNING_TOTAL =
CALCULATE (
SUM ( Outputs[Output qt] ),
FILTER (
ALLEXCEPT ( Outputs, Outputs[OP + REF] ),
Outputs[Date] <= MAX ( Outputs[Date] )
)
)
VAR _Percentage =
DIVIDE ( _RUNNING_TOTAL, SUM ( Inputs[input qty] ) )
RETURN
IF ( MAX ( Outputs[Date] ) = _Deadline, BLANK (), _Percentage )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @acbi ,
Try this code.
Running Total Percentage =
VAR _Deadline =
CALCULATE ( MAX ( Outputs[Date] ), ALLEXCEPT ( Outputs, Outputs[OP + REF] ) )
VAR _RUNNING_TOTAL =
CALCULATE (
SUM ( Outputs[Output qt] ),
FILTER (
ALLEXCEPT ( Outputs, Outputs[OP + REF] ),
Outputs[Date] <= MAX ( Outputs[Date] )
)
)
VAR _Percentage =
DIVIDE ( _RUNNING_TOTAL, SUM ( Inputs[input qty] ) )
RETURN
IF ( MAX ( Outputs[Date] ) = _Deadline, BLANK (), _Percentage )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@acbi , As of now it seem % between [qt. entrada] and [qt. saidas]
divide( [qt. saidas] , [qt. entrada] )
Can you provide exact raw data?
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
34 | |
15 | |
12 | |
7 | |
6 |