Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Hola
Tengo tabla virtual :
Facturas no pagadas ?
FILTRO (
ADDCOLUMNS (
RESUMIR (
Deuda;
Deuda[DocumentNr];
Deuda[CompanyNo];
Deuda[Día de Pago]
);
"Equilibrio"; CALCULATE (SUM (Deuda [Deuda]));
"InvoiceDate"; CALCULATE ( MAX ( Debt[InvoiceDate] ) )
);
[Saldo] > 0
)
El resultado es:
Saldo | InvoiceDate | DocumentNr | CompanyNo | Día de Pago |
117.09 | 2020-02-18 | 1 | 125887 | 2020-05-28 |
44.04 | 2020-02-05 | 2 | 125887 | 2020-05-15 |
50.32 | 2020-04-27 | 3 | 125887 | 2020-01-08 |
90.05 | 2020-03-31 | 4 | 125887 | 2020-03-09 |
202.03 | 2020-04-27 | 5 | 125887 | 2020-01-14 |
442.25 | 2020-04-16 | 6 | 125887 | 2020-05-16 |
574.03 | 2020-04-16 | 7 | 125887 | 2020-05-16 |
167.67 | 2020-04-16 | 8 | 125887 | 2020-05-16 |
133.02 | 2020-04-16 | 9 | 125887 | 2020-05-16 |
110.2 | 2020-04-17 | 10 | 125887 | 2020-05-17 |
51.03 | 2020-04-20 | 11 | 125887 | 2020-05-20 |
149.76 | 2020-04-20 | 12 | 125887 | 2020-05-20 |
500.34 | 2020-04-20 | 13 | 125887 | 2020-05-20 |
45.51 | 2020-04-22 | 14 | 125887 | 2020-05-22 |
102.74 | 2020-04-22 | 15 | 125887 | 2020-05-22 |
102.53 | 2020-04-22 | 16 | 125887 | 2020-05-22 |
71.39 | 2020-04-22 | 17 | 125887 | 2020-05-22 |
67.27 | 2020-04-22 | 18 | 125887 | 2020-05-22 |
56.61 | 2020-04-23 | 19 | 125887 | 2020-05-23 |
169.82 | 2020-04-23 | 20 | 125887 | 2020-05-23 |
177.88 | 2020-04-23 | 21 | 125887 | 2020-05-23 |
184 | 2020-04-23 | 22 | 125887 | 2020-05-23 |
34.25 | 2020-04-24 | 23 | 125887 | 2020-05-24 |
70.6 | 2020-04-28 | 24 | 125887 | 2020-05-28 |
¿Cómo podría escribir una medida que me da diferencia en días entre la fecha de factura máxima y mínima
Hola @vytas
Prueba algo como esto.
Measure =
VAR __tbl =
FILTER (
ADDCOLUMNS (
SUMMARIZE (
Debt;
Debt[DocumentNr];
Debt[CompanyNo];
Debt[PaymentDay]
);
"Saldo"; CALCULATE ( SUM ( Debt[Debt] ) );
"InvoiceDate"; CALCULATE ( MAX ( Debt[InvoiceDate] ) )
);
[Saldo] > 0
)
VAR __min = MINX( __tbl, [InvoiceDate] )
VAR __max = MAXX( __tbl, [InvoiceDate] )
RETURN
__max - __min
Eso es lo que necesitaba. Encogiéndose de hombros hasta llegar a la fecha en la tabla virtual.
Acaba de envolver return en datediff.
Gracias.
@vytas , se puede obtener
Datediff(Min(Table[Date]),Max(Table[Date]),Day)
Consulte este blog sobre cómo usar el contexto de fila para obtener la diferencia de fecha correcta