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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
Anonymous
Not applicable

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

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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