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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Fill missing stock quantity

Hello, stuck in writing measure.

I need to see whole month days and show values for days when values are missing in table.

for example, for HTC 8X, it should be showing 1 for days 7-17 april, then it should show 4 from 19-27.

Appreciate help. thanks!

 

here's pbix link

https://gepowerbi-my.sharepoint.com/:u:/g/personal/info_powerbi_ge/Ea_dwjNJLJBJtM0_UR7ljSwBYpyMavZTP... 

 

my model is this

 

Screenshot 2022-03-30 115919.jpg

 

I want to create model like this

Screenshot 2022-03-30 120002.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Inactive the relationship and create measures like below.

Measure = CALCULATE(SUM(Sheet1[QTY]),FILTER(ALL(Sheet1),Sheet1[Name]=SELECTEDVALUE(Sheet1[Name])&&Sheet1[Date]=SELECTEDVALUE('Table'[Date])))

Measure 2 = if(ISBLANK([Measure]),MAXX(filter(ALLSELECTED('Table'),[Measure]<>BLANK()&&'Table'[Date]<SELECTEDVALUE('Table'[Date])),'Table'[Date]),SELECTEDVALUE('Table'[Date]))

Measure 3 = CALCULATE(SUM(Sheet1[QTY]),FILTER(ALL(Sheet1),Sheet1[Name]=SELECTEDVALUE(Sheet1[Name])&&Sheet1[Date]=[Measure 2]))

vjaywmsft_0-1649166353501.png

 

Best Regards,

Jay

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

Inactive the relationship and create measures like below.

Measure = CALCULATE(SUM(Sheet1[QTY]),FILTER(ALL(Sheet1),Sheet1[Name]=SELECTEDVALUE(Sheet1[Name])&&Sheet1[Date]=SELECTEDVALUE('Table'[Date])))

Measure 2 = if(ISBLANK([Measure]),MAXX(filter(ALLSELECTED('Table'),[Measure]<>BLANK()&&'Table'[Date]<SELECTEDVALUE('Table'[Date])),'Table'[Date]),SELECTEDVALUE('Table'[Date]))

Measure 3 = CALCULATE(SUM(Sheet1[QTY]),FILTER(ALL(Sheet1),Sheet1[Name]=SELECTEDVALUE(Sheet1[Name])&&Sheet1[Date]=[Measure 2]))

vjaywmsft_0-1649166353501.png

 

Best Regards,

Jay

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.