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
mreese23
Frequent Visitor

Límite total de ejecución una vez que alcanza el valor objetivo

Hola

Estoy calculando un Pronóstico Mensual y mostrándolo como un gráfico de líneas Total en ejecución. El Total en ejecución es una medida. Me gustaría que el total en ejecución mostrar todos los valores/meses hasta que alcance un valor de umbral específico que actualmente se almacena como una medida también.

¿Alguna idea de la mejor manera de resolver esto?

¡Gracias!

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hola @mreese23 ,

Creo esta tabla para calcular cada operación total de ventas como una muestra:

sample data sales.png

Medida total de ejecución anterior:

Running Total =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    ALLEXCEPT ( 'Table', 'Table'[Date].[MonthNo] )
)

Nueva medida total de ejecución:

New Running total =
VAR _rt = [Running Total]
VAR _Threshold = 800 //It could also be a measure formula
RETURN
    IF ( _rt >= _Threshold, _Threshold, _rt )

Dos resultados del gráfico de líneas como comparación:

line chart compare.png

Mejores looks,
Yingjie Li

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Gracias @v-yingjl & @Greg_Deckler soluciones similares que ambos funcionaron muy bien!

Quería que el gráfico total en ejecución terminara una vez que alcanzara el umbral en lugar de aplanar, así que modifiqué la solución a esto:

New Running total =
VAR _rt = [Running Total]
VAR _Threshold = [Threshold Measure]
RETURN
    IF ( _rt >= _Threshold, -1, _rt )

A continuación, filtro las vistas para que sean [Nuevo total de ejecución] > 0.

¡Gracias de nuevo!

Greg_Deckler
Super User
Super User

Total de ejecución ?

<código actual>

devolución

<algo>

Para

Total de ejecución ?

<código actual>

VAR __runningtotal <algo>

devolución

IF(__runningtotal > [Medida de umbral],[Medida de umbral],__runningtotal)


@ 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...

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.