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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JanBauer
Frequent Visitor

Previous not blank value

Hi all,

 

I have the following matrix:

No_20152016201720182019
100114,900,000,007,000,00
1002103,55102,200,0081,150,00
1003200,69172,25105,45199,70168,30

 

The measure that caluculates the values looks like this:

 

m_maxBestand = IF(ISBLANK(MAX(_PBI_Dispo_InventoryDev[cumulativBestand]));0;MAX(_PBI_Dispo_InventoryDev[cumulativBestand]))

 

 

The table [_PBI_Dispo_InventoryDev] looks as follows (filtered on '1002' for a better overview):

No_PostingDateSumPerDayGroupIndexcumulativBestandyDatePeriod
100201.01.201523,65123,652015
100212.03.2015-6,5217,152015
100226.08.201586,43103,552015
100216.09.2015-14102,552015
100217.05.2016-0,355102,22016
100218.05.2016-2,55699,652016
100205.08.2016-3,1796,552016
100208.08.2016-8,8887,752016
100222.02.2018-6,6981,152018

 

What I want to achieve is that my measures shows the latest available value instead of 0 so that the matrix looks like the following:

No_20152016201720182019
100114,9014,9014,907,007,00
1002103,55102,20102,2081,1581,15
1003200,69172,25105,45199,70

168,30

 

Is this possible and if so - how?

 

Thanks!

 

 

10 REPLIES 10
v-lionel-msft
Community Support
Community Support

Hi @JanBauer ,

 

Is this what you want?

ee4.PNGee5.PNG

 

Best regards,
Lionel Chen

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

amitchandak
Super User
Super User

Try like

Cumm  = CALCULATE(SUM(Table[SumPerDay]),filter(table,table[No_] <=maxx(table,date[No_]) && table[yDatePeriod] =max(table[yDatePeriod]) ))
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

Hi @amitchandak,

 

can you explain the DAX formular?

 

I'm not quite sure if you understood my enquiry correctly.

 

Thanks.

 

Hi @JanBauer ,

 

Please refer to @amitchandak 's answer, if it can help you, please Accept it as the solution to help the other members find it more quickly, if not, please show the data that [No_] is equal to 1001

 

Best regards,
Lionel Chen

@JanBauer ,

 

Please find solution at https://www.dropbox.com/s/q5hxd2ztdca48nq/Previous%20not%20blank%20value.pbix?dl=0

 

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

Hi @amitchandak ,

 

thanks a lot for your reply! Sadly it's not yet the solution I need. I will try to explain again:

 

The table [_PBI_Dispo_InventoryDev] now filtered on two [No_]. I added an Index for better explanation.

 

IndexNo_PostingDateSumPerDayGroupIndexcumulativBestandyDatePeriod
1100201.01.201523,65123,652015
2100212.03.2015-6,5217,152015
3100226.08.201586,43103,552015
4100216.09.2015-14102,552015
5100217.05.2016-0,355102,22016
6100218.05.2016-2,55699,652016
7100205.08.2016-3,1796,552016
8100208.08.2016-8,8887,752016
9100222.02.2018-6,6981,15

2018

10100301.01.201514,9114,9

2015

11100318.11.2015-5,929

2015

12100302.12.2015-1,0537,95

2015

13100331.01.2018-0,9547

2018

14100301.02.2018-750

2018

 

Index 1 is the first entry (GroupIndex 1) for the No_ 1002 with the SumPerDay of 23,65 so the cumulativSum is 23,65.

Index 2 is the second entry (GroupIndex 2) for the No_ 1002 with the SumPerDay of -6,5 so the cumulativSum is 23,65 (from Index 1) - 6,5 = 17,5.

And so on...

 

The matrix table I try to achieve is the following (I also added a Index):

 

IndexNo_20152016201720182019
1100114,9014,9014,907,007,00
21002102,5587,7587,7581,1581,15
31003200,69172,25105,45199,70

168,30

 

I highlighted the values in the matrix table and in the table [_PBI_Dispo_InventoryDev] which refer to each other.  As you can see the table [_PBI_Dispo_InventoryDev] does not have values for the year 2017 or 2019. Since this means that the inventory didn't change I want to show the last available value (for example for the Index 1 column 2017 it would be the value of the year 2015 since this would be the last available value).

 

The measure you wrote didn't work for me since you calculated the sum of the column SumPerDay and it didn't show values for the 'blank years' either.

 

I hope my explanation helped to make things clearer - can you help me with the measure?

 

Thanks!

 

I have used this on both rows and col of matrix

ShowItemwithoutdata.JPG

 

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

Still does't work for me.

 

Can you look at my example file, @amitchandak - maybe this helps:

 

Example file 

@JanBauer , When I download the file, it does not download in the same format.

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

Hi @amitchandak,

 

in what format do you need it?

 

I uploaded it as a zip file with two csv files and one pbix file in the zip when you extract it. 

 

I can try sending it to you on another way - whatever suits you best 🙂

 

EDIT: I uploaded it to wetransfer - maybe this helps: https://we.tl/t-iPNs96DbQu 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors