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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

línea de color cambiante de tren en función de la fecha (eje x)

Hola

Tengo una pregunta. Tengo un gráfico de línea de tendencia simple que muestra un recuento acumulado de una variable (eje y) y la fecha en el eje X. Quiero que la línea tenga un color diferente basado en la fecha. Así que si la fecha es antes de hoy ser verde después de rojo (por ejemplo). Pensé que podría hacer esto creando un colum calculado dando un valor a "si antes de hoy entonces reals" y ""si después de hoy que el pronóstico) y usando eso como una variable de leyenda. Pero esto no funciona, alguien tiene una solución cómo cambiar los colores de la línea no en el valor del eje Y, pero basado en la fecha que es antes de hoy en el eje X? Necesita ser ajustado dependiendo de la fecha dinámicamente por lo que no puedo mannualy hacer los colores.

¡Gracias de antemano por la ayuda!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@liesaaaaw es bastante sencillo, agregue dos medidas y utilízarlas en

Before Selected Date= 
VAR __date = DATE ( 2019,1,1) --replace this with TODAY()
RETURN
 CALCULATE ( [Your Measure], KEEPFILTERS('Date'[Date] <= __date ) )

After Selected Date = 
VAR __date = DATE(2019,1,1) --you can replace it with today
RETURN
CALCULATE ( [Your Measure], KEEPFILTERS('Date'[Date] > __date ) )

aquí está la salida

image.png

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@liesaaaaw es bastante sencillo, agregue dos medidas y utilízarlas en

Before Selected Date= 
VAR __date = DATE ( 2019,1,1) --replace this with TODAY()
RETURN
 CALCULATE ( [Your Measure], KEEPFILTERS('Date'[Date] <= __date ) )

After Selected Date = 
VAR __date = DATE(2019,1,1) --you can replace it with today
RETURN
CALCULATE ( [Your Measure], KEEPFILTERS('Date'[Date] > __date ) )

aquí está la salida

image.png

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hola

Aah sí cierto. Iba a quedarme pensando en una dirección. ¡¡Muchas gracias!!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors