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

Complete a date column using another column from another table

Hi Everybody 🙂

 

I have a bit of a challenge to face right now

 

I have a table of 'Issues' that contains a column of [due dates] and sometimes value of this columns are null.

It is null because the due date is in fact the end date of the "sprint" (Agile) that the issues is being treated in.

I want that each time a issue due date is null, he will return the end date from the table 'Sprints'

 

FinalDueDate = IF(ISBLANK(Issues[due dates]), Sprints[end dates] ,Issues[due dates]])) --> this fail to work

 

Here is the data model

 

Table 'Issue' link 1 to n to Table 'IssueSprints'

Table 'IssueSprints' n to 1 Table 'Sprints'

 

Thank you so much for your help

 

 

1 ACCEPTED SOLUTION

I switched to mono directional and it worked.

Thanks a lot !

View solution in original post

12 REPLIES 12
tamerj1
Super User
Super User

Hi @MrAdrien 
I believe this should work

FinalDueDate =
IF (
    ISBLANK ( Issues[due dates] ),
    MAXX ( RELATEDTABLE ( IssueSprints ), RELATED ( Sprints[end dates] ) ),
    Issues[due dates]
)
MrAdrien
Frequent Visitor

Hi tamerj1,

 

First, thank you so much to help me. 


I want to create it in the issue table so I guess that fit the code you proposed.

But actually I have error will entering it : I get parameter is not the correct type on the values function.

 

MrAdrien_2-1649748800729.png

 

 

Also the function RelatedTable get two parameter no? In your proposition there is only one so I tried this.

 

FinalDueDate =
IF (
ISBLANK ( Issues[ISSUE_DUE_DATE] ),
MAXX (
CALCULATETABLE ( RELATEDTABLE ( VALUES ( Sprints[SPRINT_END_DATE] ),Sprints[SPRINT_END_DATE] ) ),
Sprints[SPRINT_END_DATE]
),
Issues[ISSUE_DUE_DATE]
)

 

Thanks again for your help

 

 

 

 

@MrAdrien 
Try

FinalDueDate =
IF (
    ISBLANK ( Issues[due dates] ),
    MAXX (
        CALCULATETABLE ( RELATEDTABLE ( Sprints ) ),
        Sprints[end dates]
    ),
    Issues[due dates]
)

Thank you so much for your reactivity.

Syntax is valid but unfortunately date from sprints table or not retrieve (I got a blank return).

Is it because there is an intermediate table between Issues and sprints which is SprintIssues?

Here is a picture of the model.

MrAdrien_0-1649750222247.png

 

@MrAdrien 
Seems you have two directional relationships. Try either

FinalDueDate =
IF (
    ISBLANK ( Issues[due dates] ),
    RELATED ( Sprints[end dates] ),
    Issues[due dates]
)
FinalDueDate =
IF (
    ISBLANK ( Issues[due dates] ),
    MAXX ( RELATEDTABLE ( Sprints ), Sprints[end dates] ),
    Issues[due dates]
)

 @tamerj1 

First solution seems not accepted

MrAdrien_0-1649752165839.png

I cannot call this column with the related function, it doesn't seems to allow it.

 

Second solution have the same result than the initial one 

 

 

FinalDueDate =
IF (
    ISBLANK ( Issues[due dates] ),
    CALCULATE ( MAX ( Sprints[end dates] ) ),
    Issues[due dates]
)

 

 

@tamerj1 

Problem of blank result still there 😞

(I have double check that I have data on the sprints table for this column)

Can the problem come from the fact that there is a bidirectionnal relationship?

 

I do a calculated column not a measure by the way.

Yes. Bidirectional relationships cannot be predicted. Can you please share sample file

I switched to mono directional and it worked.

Thanks a lot !

tamerj1
Super User
Super User

@MrAdrien 

You may try

FinalDueDate =
IF (
    ISBLANK ( Issues[due dates] ),
    MAXX (
        CALCULATETABLE ( RELATEDTABLE ( VALUES ( Sprints[end dates] ) ) ),
        Sprints[end dates]
    ),
    Issues[due dates]
)
tamerj1
Super User
Super User

@MrAdrien 

In which table are you creating this column?

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.