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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
BYENER
Helper V
Helper V

Return last week value if there is no value

Hi,

 

I have a matrix with values per day. How can I return the last week values to another week where I don't have value (blank)?

 

For example column B:  4/1/2021 is empty so I will return the value from 28/12/2020 (16748) to 04/01/2021. 

BYENER_0-1610523932100.png

 

Thanks in advance.

6 REPLIES 6
Anonymous
Not applicable

Hi @BYENER ,

 

I made a test file myself, please refer to it.

Measure = 
IF (
    ISBLANK ( MAX ( 'Table'[Value] ) ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALL ( 'Table' ), [Date] = MAX ( 'Table'[Date] ) - 7 )
    ),
    MAX ( 'Table'[Value] )
)

2.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,

 

This works perfect! But I will copy this value not only to next week but to all weeks in the future what is blank. How can I do that?

BYENER_0-1610970440290.png

it's filled till 15/01 but I want till 27/01

 

Kind regads

Bahar

amitchandak
Super User
Super User

@BYENER , 7 days before or last week

Assume you have measure sales

if(isblank([sales]), CALCULATE(([Sales]),dateadd('Date'[Date],-7,DAy)),[Sales])

 

You can do the same for this week vs last week. Refer to my blog for that

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I used your formula, but I get this (last column)

 

BYENER_1-1610525306705.png

 

 

@BYENER , you are using date table and the week is from the date table?

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Yes, its from the the date table.

 

See example pbix. https://www.dropbox.com/s/4jbsrruvdjhin2w/test.pbix?dl=0

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors