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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
David_Marks
Frequent Visitor

replicate datas from the last month to the next 2 months.

I need a measure that copies the data from the last month to the next 2 months (only 2 months) if it is blank? and when you have the real value of the month replace the copied value to the real value of the month.

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @David_Marks 

Try this:

Measure = 
var _sum=SUM('Table16'[Sale])
var _pre1=CALCULATE(SUM(Table16[Sale]),FILTER(ALL(Table16),'Table16'[Date]=EDATE(MAX('Table16'[Date]),-1)))
var _pre2=CALCULATE(SUM(Table16[Sale]),FILTER(ALL(Table16),'Table16'[Date]=EDATE(MAX('Table16'[Date]),-2)))
var _if=
IF(_sum<>BLANK(),_sum,IF(_pre1<>BLANK(),_pre1,_pre2))

return _if

 

Result:

vangzhengmsft_0-1646115118123.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

Hi, @David_Marks 

Try this:

Measure = 
var _sum=SUM('Table16'[Sale])
var _pre1=CALCULATE(SUM(Table16[Sale]),FILTER(ALL(Table16),'Table16'[Date]=EDATE(MAX('Table16'[Date]),-1)))
var _pre2=CALCULATE(SUM(Table16[Sale]),FILTER(ALL(Table16),'Table16'[Date]=EDATE(MAX('Table16'[Date]),-2)))
var _if=
IF(_sum<>BLANK(),_sum,IF(_pre1<>BLANK(),_pre1,_pre2))

return _if

 

Result:

vangzhengmsft_0-1646115118123.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Please show the expected outcome.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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