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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Fill in the gaps in meter reading table

Hi all,

I really stuck here to fill in the gap.  Please help!!

From:

babyjb123_1-1655147135755.png

To:

babyjb123_2-1655147147659.png

Thank you!!!!

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

Hi @Anonymous 

Create a column like this :

Column 2 = 
var _a= CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[Type]=EARLIER('Table'[Type])&&[Date]<EARLIER('Table'[Date])&&[Reading]<>BLANK()))
return IF([Reading]<>BLANK(),[Reading],CALCULATE(MAX('Table'[Reading]),FILTER(ALL('Table'),[Type]=EARLIER('Table'[Type])&&[Date]=_a)))

The final result is as shown :

Ailsamsft_0-1655361422998.png

I have attached my pbix file , you can refer to it .

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yetao1-msft
Community Support
Community Support

Hi @Anonymous 

Create a column like this :

Column 2 = 
var _a= CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[Type]=EARLIER('Table'[Type])&&[Date]<EARLIER('Table'[Date])&&[Reading]<>BLANK()))
return IF([Reading]<>BLANK(),[Reading],CALCULATE(MAX('Table'[Reading]),FILTER(ALL('Table'),[Type]=EARLIER('Table'[Type])&&[Date]=_a)))

The final result is as shown :

Ailsamsft_0-1655361422998.png

I have attached my pbix file , you can refer to it .

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

What my DAX is :

Average to Everyday =
VAR LastNonBlankDate =
CALCULATE (
LASTNONBLANK ( 'Meter Reading All'[G/L Date], 1 ),
FILTER (
ALL ( 'Meter Reading All' ),
'Meter Reading All'[Date]<= EARLIER ( 'Meter Reading All'[Date] )
)
)
 
RETURN
CALCULATE (
SUM ( 'Meter Reading All'[Average Reading] ),
FILTER ( ALL ( 'Meter Reading All' ),'Meter Reading All'[Date] = LastNonBlankDate )
)
 
but it is not right.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.