cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
babyjb123
Helper II
Helper II

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
Ailsa-msft
Community Support
Community Support

Hi @babyjb123 

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
Ailsa-msft
Community Support
Community Support

Hi @babyjb123 

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.

babyjb123
Helper II
Helper II

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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors