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
MauroBote
Helper I
Helper I

Relacionando la segmentación de fecha con un gráfico de líneas de fecha de calendario

Hola amigos.

Tengo una tabla de calendario (CALENDARIO) creada con el mínimo y el máximo de 2 fechas de columnas ([Fecha de plan] y [Fecha real]) de otra tabla (HITOS), y la uso para el eje X de un gráfico de líneas. También tengo una segmentación de fecha (entre) creada con la columna [Fecha de plan] de la misma tabla utilizada antes (HITOS).

En el modelo, he determinado 2 relaciones diferentes entre las 2 tablas:

  • HITOS[Plan Date] with CALENDARIO[Date]
  • HITOS[Real Date] with CALENDARIO[Date]

Ambas relaciones son inactivas.

Por lo tanto, necesito una manera de cambiar el eje X del gráfico de líneas con las fechas seleccionadas en la segmentación.

Ahora tengo este resultado:

As Is.png

Y necesito este (he cambiado el filtro de fecha manualmente):

To Be.png

El modelo:

Model.png

¿Alguien puede ayudarme, por favor?

¡Gracias!

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hola @MauroBote

Sólo tiene que hacer algunos cambios en la fórmula de las dos medidas.

Por favor, comparta su archivo pbix de muestra para que tengamos una prueba, que será una gran ayuda.

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.

Hola Lin.

Aquí está el archivo: https://www.dropbox.com/s/0xk4jnixjrb55u4/Curva%20S.pbix?dl=0

¡Gracias!

hola @MauroBote

Sólo el ajuste de las dos medidas como se muestra a continuación:

PLAN AC =
CALCULATE(
SUM(HITOS[PESO]),
USERELATIONSHIP(CALENDARIO[Date],HITOS[FECHA PLAN]),FILTER(
ALLSELECTED(CALENDARIO[Date]),MAX(CALENDARIO[Date])<=MAX(HITOS[FECHA PLAN])&&
ISONORAFTER(CALENDARIO[Date], MAX(CALENDARIO[Date]), DESC)
)
)/HITOS[Total % PESO]

REAL AC ?
IF(max(CALENDARIO([Date])>today(),"",CALCULATE(
SUM(HITOS[AVANCE REAL]),
USERELATIONSHIP(CALENDARIO[Date],HITOS[FECHA REAL 2]),HITOS[FECHA REAL 2]<>BLANK(),FILTER(
ALLSELECTED(CALENDAR[Fecha]),
ISONORAFTER(CALENDARIO[Date], MAX(CALENDARIO[Date]), DESC)
)
)/HITOS[Total % PESO])

Resultado:

1.JPG

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.

Muchas gracias Lin. Eres un genio!!!

amitchandak
Super User
Super User

@MauroBote

recomienda

plan =
var _min = minx(CALENDARIO,CALENDARIO[Date])
return
calculate(sum(HITOS[Plan Value]),filter(CALENDARIO,CALENDARIO[Date]>=_min &&CALENDARIO[Date]<=max(CALENDARIO[Date]))
,userelation(HITOS[Plan Date] , CALENDARIO[Date]))


actual =
var _min = minx(CALENDARIO,CALENDARIO[Date])
return
calculate(sum(HITOS[Real Value]),filter(CALENDARIO,CALENDARIO[Date]>=_min &&CALENDARIO[Date]<=max(CALENDARIO[Date]))
userelation(HITOS[Real Date] , CALENDARIO[Date]))
Greg_Deckler
Super User
Super User

Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


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