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

datediff of childs row in table with parent row table

Hi. i have a problem. i'm new on power BI

 

i have a table that contains childs and parent rows, and in other table i have only the child rows every row of both tables have start date and end date. i have to calculate total diff time of parent row and child rows. i have the following DAX expression:

 

tiempoResolucion = DATEDIFF(incidencias[fecha_inicio];incidencias[fecha_fin]; MINUTE) + CALCULATE(
SUMX(
incidenciasHijas;
DATEDIFF(incidenciasHijas[fecha_inicio];incidenciasHijas[fecha_fin]; MINUTE)
),
incidencias[id_padre] <> BLANK()

 

it returns me the following error: 

A circular dependency was detected: incidencias[tiempoResolucion], incidenciasHijas[fecha_fin], incidenciasHijas[incidenciasHijas-5d28653b-e27d-4379-bc24-c4258834cb23], incidencias[tiempoResolucion].

 

somebody can tell me how can i solve this and why this error?

thanks 

4 REPLIES 4
v-ljerr-msft
Employee
Employee

Hi @maxpower,

 

Could you try the formula below to see if it works in your scenario? Smiley Happy

tiempoResolucion =
DATEDIFF ( incidencias[fecha_inicio]; incidencias[fecha_fin]; MINUTE )
    + IF (
        incidencias[id_padre] <> BLANK ();
        SUMX (
            incidenciasHijas;
            DATEDIFF ( incidenciasHijas[fecha_inicio]; incidenciasHijas[fecha_fin]; MINUTE )
        )
    )

 

Regards

thanks for response but the expression not works. it continues showing the same error "A circular dependency was detected: incidencias[tiempoResolucion], incidenciasHijas[fecha_fin], incidenciasHijas[incidenciasHijas-5d28653b-e27d-4379-bc24-c4258834cb23], incidencias[tiempoResolucion]."

 

i don't know if is important but the table that contains child rows can contains 1 or more rows to the same parent row ( 1 - * )

Hi @maxpower,

 

Could you post your table structures(including the relationships) with some sample/mock data which can help us reproduce this issue, so that we can better assist on it? It's even better to share a sample pbix file(with just some mock data) which can reproduce the issue. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploadingSmiley Happy

 

Regards

it's not possible. sorry 😞

 

i tell you my steps i hope it helps to get the error.

 

i import a mysql table "incidencias" wich is relationed with other tables.

 

i create in modeling view a table called "incidenciasHijas"  incidenciasHijas = FILTER(incidencias;incidencias[id_padre] <> BLANK() )

 

in table incidencias i create a new column called "tiempoResolucion" with the formula described in the previous post. 

 

i see now that when i create the new column (tiempoResolucion) automatically it's created the same column in the table "incidenciasHijas" why is the reason? i would to create table with other method?? 

 

thanks

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.