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

How to fill missing out row with below valid value, like previous row content

Hi All,

Please check below table, i took a portion of a big dateset, i need to fill above cell identified as "Check", with below cell value ,

for single above value with below DAX i can get, not more than one value i could not get, Hope some one can

if('F_Data (2)'[Custom] = "Check",
LOOKUPVALUE(
'F_Data (2)'[Custom],
'F_Data (2)'[Index],
'F_Data (2)'[Index] +1 ),
'F_Data (2)'[Custom])

 

DNoIndexProgressDate1Date2 (Check)Required like this
ABC-CC-DD-EE-01'115%10-Jan-202110-Jan-202110-Jan-2021
ABC-CC-DD-EE-01'245%null Check15-Mar-2021
ABC-CC-DD-EE-01'3100%15-Mar-202115-Mar-202115-Ma-2021
ABC-CC-DD-EE-02'410%5-May-20215-May-20215-May-2020
ABC-CC-DD-EE-02'525% null Check12-Jun-2020
ABC-CC-DD-EE-02'665%null Check12-Jun-2020
ABC-CC-DD-EE-02'790%12-Jun-202112-Jun-202112-Jun-2020
ABC-CC-DD-EE-02'8100%null  
ABC-CC-DD-EE-03'95%10-Jan-2021 10-Jan-202110-Jan-2021
ABC-CC-DD-EE-03'1015%nullCheck15-Jun-2020
ABC-CC-DD-EE-03'1125%nullCheck15-Jun-2020
ABC-CC-DD-EE-03'1145%15-Jun-202115-Jun-202115-Jun-2020
ABC-CC-DD-EE-03'1275%nullCheck20-Jun-2020
ABC-CC-DD-EE-03'1390%nullCheck20-Jun-2021
ABC-CC-DD-EE-03'14100%20-Jun-202120-Jun-202120-Jun-2021
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @aashok611 ,

 

Try the following code for a calculated column:

 

 

CheckDateFill = 
IF (
    'CheckDateTable'[Date2 (Check)] = "Check",
    SELECTCOLUMNS (
        TOPN (
            1,
            FILTER (
                ALL ( 'CheckDateTable' ),
                'CheckDateTable'[Index] > EARLIER ( 'CheckDateTable'[Index] )
                    && 'CheckDateTable'[Date2 (Check)] <> "Check"
            )
        ),
        "DateCheck", 'CheckDateTable'[Date1]
    ),
    'CheckDateTable'[Date1]
)

 

 

MFelix_0-1626946421744.png

 


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

1 REPLY 1
MFelix
Super User
Super User

Hi @aashok611 ,

 

Try the following code for a calculated column:

 

 

CheckDateFill = 
IF (
    'CheckDateTable'[Date2 (Check)] = "Check",
    SELECTCOLUMNS (
        TOPN (
            1,
            FILTER (
                ALL ( 'CheckDateTable' ),
                'CheckDateTable'[Index] > EARLIER ( 'CheckDateTable'[Index] )
                    && 'CheckDateTable'[Date2 (Check)] <> "Check"
            )
        ),
        "DateCheck", 'CheckDateTable'[Date1]
    ),
    'CheckDateTable'[Date1]
)

 

 

MFelix_0-1626946421744.png

 


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.