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
Juju123
Helper III
Helper III

Replace blank value by previous values cumul data

 
Hi,

I have a table in which I calculated the cumulative quantity in DAX:

Cumul quantity = calculate (SUM('table_fact'[Quantityu]),
DATESYTD('table_calendar'[Date]))

 

I have a problem that I can't solve, when I have an empty value, I want to replace it with the previous value.

In my example, I have no data after January 2023 so all years after February 2023 will take the previous value, i.e. 5. How can I solve this problem?

Juju123_0-1698666104023.png

 

THANKS 

Juju123_1-1698666104027.png

 

4 REPLIES 4
Rupak_bi
Super User
Super User

Rupak_bi_0-1698924271436.png

Even if its direct query, the formula should work. In above case the fact table is direct query and date table is static.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Hi @Rupak_bi , 

 

ok I try your formula and I get back you say if work or not 

 

thanks you

Rupak_bi
Super User
Super User

Hope this will work.....

 

Rupak_bi_0-1698668319143.png

 



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Hi @Rupak_bi , 

I'm on DirectQuery Mode and your formula doesn't work. 

1. I create a measure which calculate the cumul like this : 

Cumul quantity = calculate (SUM('table_fact'[Quantityu]),
DATESYTD('table_calendar'[Date]))

When i want to use this measure in calculate like your example, it's doesn't work

 

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.