Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Fill in gaps in meter reading table

Hi,

I really stuck here to fill in the gap. I failed to use LASTNONBLANKVALUE, Please help!!

 

babyjb123_0-1652120622760.png

 

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

HI @Anonymous ,

Test the below to create a new column:

newaverage =
IF (
'Table'[average] = BLANK (),
CALCULATE (
MAX ( 'Table'[average] ),
FILTER (
ALL ( 'Table' ),
'Table'[average] <> BLANK ()
&& 'Table'[Date] >= EARLIER ( 'Table'[Date] )
)
),
'Table'[average]
)

vluwangmsft_0-1652345738739.png

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


Best Regards

Lucien

View solution in original post

4 REPLIES 4
v-luwang-msft
Community Support
Community Support

HI @Anonymous ,

Test the below to create a new column:

newaverage =
IF (
'Table'[average] = BLANK (),
CALCULATE (
MAX ( 'Table'[average] ),
FILTER (
ALL ( 'Table' ),
'Table'[average] <> BLANK ()
&& 'Table'[Date] >= EARLIER ( 'Table'[Date] )
)
),
'Table'[average]
)

vluwangmsft_0-1652345738739.png

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


Best Regards

Lucien

Anonymous
Not applicable

I just checked your result, there is a bug need to debug.

Hi @Anonymous ,

Thank you for pointing this out, I have made the adjustment, see below:

newaverage = 
VAR MAXDATE =
    CALCULATE (
        MIN ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[average] <> BLANK ()
                && 'Table'[Date] >= EARLIER ( 'Table'[Date] )
        )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[average] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Date] = MAXDATE )
    )

 

 

vluwangmsft_0-1652406325109.png

 

 

Best Regards

Lucien

speedramps
Super User
Super User

Hi  babyjb123

 

You have given very little infomation. Please give detailed infomation when postng question on the forum. Thank you. Have you tried using Fill down in the columns in the query editor?

PREVIEW

🙁

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.