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
Anonymous
Not applicable

Next Non Blank Value from Calculated Column

Hi all,

 

First of all, what I'm trying to achieve will not be possible with a fill down method as all operations are being done to calculated columns. So I'd need a DAX calculated column to solve this issue. 

I have the following table that contains an Index that defines a certain contact (we are looking at data for contact # 3 below), IndexDateRank, which orders the entries per contact by date, and Stage, that may or may not have a value for each entry. I want to be able to generate an Outcome column where it calculates what's the next non blank value, as seen below:

 

IndexIndexDateRankStageOutcome
3163
32  
33  
34  
35  
3631
37  
38  
39  
310  
311  
312  
313  
31411
315  
316  
317  
318  
319  
32015
321  
322  
323  
32455
325  

         

Does anyone have a solution on how to generate the Outcome column?

 

Thanks in advance,

Antonio

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

Try calculated column as below:

 

Column =
VAR index_ =
    CALCULATE (
        MIN ( [IndexDateRank] ),
        FILTER (
            'Table',
            [IndexDateRank] > EARLIER ( [IndexDateRank] )
                && [Stage] <> BLANK ()
        )
    )
RETURN
    IF (
        [Stage] = BLANK (),
        BLANK (),
        CALCULATE (
            MIN ( 'Table'[Stage] ),
            FILTER ( 'Table', [IndexDateRank] = index_ )
        )
    )

 

 

The column result will show as below:

25.png

 

Please check attached pbix file for more details.

Best Regards,
Community Support Team _ Eason

 

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

Try calculated column as below:

 

Column =
VAR index_ =
    CALCULATE (
        MIN ( [IndexDateRank] ),
        FILTER (
            'Table',
            [IndexDateRank] > EARLIER ( [IndexDateRank] )
                && [Stage] <> BLANK ()
        )
    )
RETURN
    IF (
        [Stage] = BLANK (),
        BLANK (),
        CALCULATE (
            MIN ( 'Table'[Stage] ),
            FILTER ( 'Table', [IndexDateRank] = index_ )
        )
    )

 

 

The column result will show as below:

25.png

 

Please check attached pbix file for more details.

Best Regards,
Community Support Team _ Eason

 

Anonymous
Not applicable

Hi Eason,

 

Wow that's exactly it! You made it look so easy and elegant!

Thank you very much.

 

Best regards,

Antonio

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.