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

Gráfico de líneas con dos fechas diferentes en los ejes X

Hola a todos,
Estoy usando mis datos jira para crear un panel en PowerBI. Mi objetivo es crear un gráfico de líneas que muestre los problemas acumulados resueltos y creados a lo largo del tiempo.

La tabla "Jira", por ejemplo, tiene este aspecto:

ClaveDate_createdDate_resolved
A12.19.201901.28.2020
B02.01.202003.01.2020
C05.06.2020

Utilizo Medir para acumular los problemas creados y resueltos a lo largo del tiempo.

Cumulative_issues_created - CALCULATE(
COUNT('Jira'[Date_created]),
FILTRO(ALLSELECTED('Jira'),
'Jira'[Date_created] <'MAX('Jira'[Date_created]))
)
Y
Cumulative_issues_resolved - CALCULATE(
CUENTA('Jira'[Date_resolved]),
FILTRO(ALLSELECTED('Jira'),
'Jira'[Date_resolved] <' MAX('Jira'[Date_resolved]))
)

El problema es que no sé qué datos debo usar para los ejes X de mi gráfico de líneas. Si estoy usando "Date_created", por ejemplo parece que la clave A se crea y se resuelve en diciembre. Pero el problema se creó en diciembre y se resuelve en enero.
¿Alguien tiene una solución para este problema?
Gracias de antemano.
2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hola @PhiBu ,

Para resolver este problema, debe crear una tabla de calendario y utilizarla como valor del eje X.

Ahora cambie sus medidas a:

Cumulative_issues_created = CALCULATE(
     COUNT('Jira'[Key ]);
     FILTER(ALL(Jira[Date_created]);
     'Jira'[Date_created] <= MAX('Calendar'[Date]))
)

Cumulative_issues_resolved = CALCULATE(
     COUNT('Jira'[Key ]);
     FILTER(ALLSELECTED(Jira[Date_resolved]);
     'Jira'[Date_resolved] <= MAX('Calendar'[Date]) && Jira[Date_resolved] <> BLANK())
 )

Asumo que la fecha de creación no tiene valores en blanco.

Compruebe la conexión de archivos PBIX (archivo en la versión de abril).


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

v-shex-msft
Community Support
Community Support

Hola @PhiBu,

También puede intentar crear una tabla calculada para expandir el intervalo de fechas y vincularlo a registros de tabla sin procesar (campo clave), a continuación, puede utilizar nuevos campos de fecha de tabla con campos de valor de tabla sin procesar para calcular el recuento de registros entre el intervalo de fechas:

Expand = 
VAR _calendar =
    CALENDAR (
        MIN ( Jira[Date_created] ),
        MAX ( MAX ( Jira[Date_resolved] ), TODAY () )
    )
RETURN
    SELECTCOLUMNS (
        FILTER (
            CROSSJOIN ( Jira, _calendar ),
            Jira[Date_created] <= [Date]
                && IF (
                    Jira[Date_resolved] <> BLANK (),
                    Jira[Date_resolved] >= [Date],
                    TODAY () >= [Date]
                )
        ),
        "Key", [Key],
        "Date", [Date]
    )

6.png7.png

Distribuya los ingresos a lo largo del período en función de la fecha de inicio y finalización, cort...

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hola @PhiBu,

También puede intentar crear una tabla calculada para expandir el intervalo de fechas y vincularlo a registros de tabla sin procesar (campo clave), a continuación, puede utilizar nuevos campos de fecha de tabla con campos de valor de tabla sin procesar para calcular el recuento de registros entre el intervalo de fechas:

Expand = 
VAR _calendar =
    CALENDAR (
        MIN ( Jira[Date_created] ),
        MAX ( MAX ( Jira[Date_resolved] ), TODAY () )
    )
RETURN
    SELECTCOLUMNS (
        FILTER (
            CROSSJOIN ( Jira, _calendar ),
            Jira[Date_created] <= [Date]
                && IF (
                    Jira[Date_resolved] <> BLANK (),
                    Jira[Date_resolved] >= [Date],
                    TODAY () >= [Date]
                )
        ),
        "Key", [Key],
        "Date", [Date]
    )

6.png7.png

Distribuya los ingresos a lo largo del período en función de la fecha de inicio y finalización, cort...

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
MFelix
Super User
Super User

Hola @PhiBu ,

Para resolver este problema, debe crear una tabla de calendario y utilizarla como valor del eje X.

Ahora cambie sus medidas a:

Cumulative_issues_created = CALCULATE(
     COUNT('Jira'[Key ]);
     FILTER(ALL(Jira[Date_created]);
     'Jira'[Date_created] <= MAX('Calendar'[Date]))
)

Cumulative_issues_resolved = CALCULATE(
     COUNT('Jira'[Key ]);
     FILTER(ALLSELECTED(Jira[Date_resolved]);
     'Jira'[Date_resolved] <= MAX('Calendar'[Date]) && Jira[Date_resolved] <> BLANK())
 )

Asumo que la fecha de creación no tiene valores en blanco.

Compruebe la conexión de archivos PBIX (archivo en la versión de abril).


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.

Top Kudoed Authors