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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. 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
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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors