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
Cbutler
Helper III
Helper III

El valor anterior no funciona??

Hola

Tengo una tabla simple que describe un nombre de medida, el RAG de esa medida con respecto a una fecha (fecha de finalización de cuartos).

La tabla no tiene fechas para todos los días, sólo en la fecha de finalización del trimestre.
He hecho una tabla de calendario para vincular hasta esta fecha.

He convertido el "RAG" en un valor rojo 1, ámbar 2, verde 3 y cualquier otra cosa a 1000.
Estoy tratando de traer de vuelta el "valor anterior" para que pueda crear un cálculo de tendencia, sin embargo todo lo que he intentado no está funcionando.

Previous RAG.PNG


¿Alguna idea?

1 ACCEPTED SOLUTION

Hola

Esta fórmula de columna calculada funciona

Column = LOOKUPVALUE('RAG by measure ID'[RAG],'RAG by measure ID'[Measure ID],'RAG by measure ID'[Measure ID],'RAG by measure ID'[Date],CALCULATE(MAX('RAG by measure ID'[Date]),FILTER('RAG by measure ID','RAG by measure ID'[Measure ID]=EARLIER('RAG by measure ID'[Measure ID])&&'RAG by measure ID'[Date]<EARLIER('RAG by measure ID'[Date]))))

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

@Cbutler ¿Puede publicar esos datos como texto para que pueda volver a crearlo en un archivo PBIX? No quiero escribir todo eso.


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

Gracias, he extraído algunos de los datos, ¿puede acceder a este enlace?

enlace eliminado

Hola

Esta fórmula de columna calculada funciona

Column = LOOKUPVALUE('RAG by measure ID'[RAG],'RAG by measure ID'[Measure ID],'RAG by measure ID'[Measure ID],'RAG by measure ID'[Date],CALCULATE(MAX('RAG by measure ID'[Date]),FILTER('RAG by measure ID','RAG by measure ID'[Measure ID]=EARLIER('RAG by measure ID'[Measure ID])&&'RAG by measure ID'[Date]<EARLIER('RAG by measure ID'[Date]))))

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

¡Sí, @Ashish_Mathur gracias! 🙂 Eso es todo.

Por interés, ¿sabe @Ashish_Mathur @Greg_Deckler por qué PreviousQuarter no trabajaba para este cálculo?
He hecho medidas similares en otros informes y ha funcionado muy bien, pero este no estaba teniendo nada de eso y no entiendo por qué....?

Gracias de nuevo por su ayuda, ambos.

Greg_Deckler
Super User
Super User

@Cbutler - Debe ser algo a lo largo de las siguientes líneas de:

Previous rag =
  VAR __Date = [Date]
  VAR __Measure = [Measure]
  VAR __PreviousDate = MAXX(FILTER('Table',[Date]<__Date && [Measure]=__Measure),[Date])
RETURN
  MAXX(FILTER('Table',[Date]=__PreviousDate && [Measure]=__Measure),[RAG])

@ 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

Intenté esto, pero no funcioné 😞

*Rag anterior ?
VAR __Date - ALL('QR Measures'[Date])
VAR __Measure - ALL('QR Measures'[Id])
SER __PreviousDate ?
MAXX ( FILTER ( 'Medidas QR', 'Medidas QR'[Fecha] < __Date && 'Medidas QR'[Id] - __Measure ), 'Medidas QR'[Fecha] )
devolución
MAXX (
FILTRO ( 'Medidas QR', 'Medidas QR'[Fecha] - __PreviousDate && 'Medidas QR'[Id]- __Measure ),
'Medidas QR'[RAG]
)

@Cbutler Entonces, ¿puede publicar los datos de muestra como texto?


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