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
Anonymous
Not applicable

Replicate same value in all month where revenue is blank till we have new non blank revenue.

Need to replicate 89.23 in all monthsNeed to replicate 89.23 in all months

Price Index = CALCULATE(Price_Index_Query[Price_Index_Working],DATEADD('Calendar'[Date],-1,MONTH))
 
This is the DAX I am currently using it replicates only for one month needs to replicate till we find a value in invoice revenue.
1 ACCEPTED SOLUTION
DallasBaba
Skilled Sharer
Skilled Sharer

@Anonymous you can do this by creating a calculated column  

 

Revenue_Filled =
VAR _currentDate = MAX('Calendar'[Date])
VAR _lastNonBlankDate =
CALCULATE(
MAX('Calendar'[Date]),
FILTER(
ALL('Calendar'),
'Calendar'[Date] <= _currentDate &&
NOT(ISBLANK(Price_Index_Query[Price_Index_Working]))
)
)
RETURN
CALCULATE(
MAX(Price_Index_Query[Price_Index_Working]),
FILTER(
ALL('Calendar'),
'Calendar'[Date] = _lastNonBlankDate
)
)

 

This formula works by finding the last date that has a non-blank revenue value for each row, and then returning the revenue value for that date. This way, the blanks are filled with the previous non-blank value until a new non-blank value is encountered.


Let me know is this work
@ me in replies or I'll lose your thread!!!

 

Thanks

Thanks
Dallas

View solution in original post

2 REPLIES 2
DallasBaba
Skilled Sharer
Skilled Sharer

@Anonymous you can do this by creating a calculated column  

 

Revenue_Filled =
VAR _currentDate = MAX('Calendar'[Date])
VAR _lastNonBlankDate =
CALCULATE(
MAX('Calendar'[Date]),
FILTER(
ALL('Calendar'),
'Calendar'[Date] <= _currentDate &&
NOT(ISBLANK(Price_Index_Query[Price_Index_Working]))
)
)
RETURN
CALCULATE(
MAX(Price_Index_Query[Price_Index_Working]),
FILTER(
ALL('Calendar'),
'Calendar'[Date] = _lastNonBlankDate
)
)

 

This formula works by finding the last date that has a non-blank revenue value for each row, and then returning the revenue value for that date. This way, the blanks are filled with the previous non-blank value until a new non-blank value is encountered.


Let me know is this work
@ me in replies or I'll lose your thread!!!

 

Thanks

Thanks
Dallas
Anonymous
Not applicable

Thank you very much for the response .it works 

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.