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

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
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.