Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Russ
Helper I
Helper I

Medida total de ejecución problemática por ID de transacción: lenta e incoherente.

Tener un modelo de Power Bi con dos tablas: Contabilidad y Fechas , vinculadas por campo de fecha.

El libro mayor contiene los siguientes campos, con datos de varios años.

Russ_0-1598363756497.png

Me gustaría producir una matriz con los siguientes campos:

Libro de contabilidad [TransID]

Fechas [Fecha]

[Importe total] - Medida

[Cantidad de Runtotal por TransID] - Medida

Tengo las dos medidas siguientes:

Total Amount = 
    SUM ( Ledger[Amount] )


Runtotal Amount By TransID =
CALCULATE (
    [Total Amount],
    ALL ( Dates[Date] ),
    FILTER ( ALL ( Ledger[TransID] ), Ledger[TransID] <= MAX ( Ledger[TransID] ) )

Me gustaría que el Runtotal fuera de TransID y no fecha. Además, se calculará a lo largo de todo el tiempo, por lo tanto Todo (Fechas[Fecha]. La matriz también se segmentará por fecha o cuenta, pero esto no debería tener ningún efecto en la medida RunTotal.

La medida Runtotal parece funcionar bien por sí sola y también en una matriz junto con Ledger [TransID] y [Importe total]. Esto tarda poco más de un segundo en calcularse.

Sin embargo, tan pronto como agrego el campo Fechas [Fecha] a la matriz, el tiempo de proceso se ejecuta en minutos.

Espero que haya una mejor manera de lograr mi salida deseada. Me he metido con Summarize y AddCoulmns, pero en vano.

¿Alguna idea?

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

Hola @Russ

Puede probar esta fórmula como se indica a continuación:

Runtotal Amount By TransID = 
CALCULATE (
    [Total Amount],
    ALL ( Dates ),
    FILTER ( ALL ( Ledger[TransID] ), Ledger[TransID] <= MAX ( Ledger[TransID] ) ))

Utilice ALL ( Fechas ) en lugar de ALL ( Fechas[Fecha] )

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

@Russ - Tal vez intente:

Runtotal Amount By TransID =
CALCULATE (
    [Total Amount],
    FILTER ( ALL ( Ledger[TransID] ), Ledger[TransID] <= MAX ( Ledger[TransID] ) )

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler - gracias, pero eso no lo arregla. El rendimiento es exactamente el mismo. Además, si segmenta por fecha, hace que Runtotal sea incorrecto.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.