Forum Discussion
Find previous blank value in previous rows
- 5 years ago
Hi 11097486 ,
You can create a calculated column like this:
Re = CALCULATE ( MAX ( 'Table'[Date1] ), FILTER ( ALL ( 'Table' ), 'Table'[Date1] < EARLIER ( 'Table'[Date1] ) && 'Table'[Column1] = BLANK () ) )Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
you need to provide in a usable format, you cannot copy and paste that. If you need help its preferable you provide it in a usable format.
How do you know the sequence of the data is it date sorted? what if you have duplicates or is it unique dates only?
Hello, yes it is date sorted and there won't be any duplicates. I cannot insert files. Creating the table should take 2 minutes... Thank you
- v-yingjl5 years ago
Community Support
Hi 11097486 ,
You can create a calculated column like this:
Re = CALCULATE ( MAX ( 'Table'[Date1] ), FILTER ( ALL ( 'Table' ), 'Table'[Date1] < EARLIER ( 'Table'[Date1] ) && 'Table'[Column1] = BLANK () ) )Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- 110974865 years ago
Helper I
It works perfectly! Thank you!
- Anonymous5 years agoNot applicable
Hi,
My table is getting created in PowerBI model itself and I dont have the same coming from the query. It is essentially a bigger challenge that I am trying to solve with this exercise- I will be tabulating this and assigning a variable to this table and use it in my next calculation, hence wanted to use DAX for this, please help!
- Anonymous5 years agoNot applicable
Hi, Can you please help me with a similar query:
I have a table in which I have a product key, date filter, stages, and cost to it. The stages change from one to other at certain dates and not all dates. What I want to do is populate the last nonblank value of a stage for a given product key(given the sorting of Date is Ascending for each Product key). So my table looks like this:
Product Key Date Stage Cost xyz 1/8/2020 borrow 10 xyz 1/9/2020 10 xyz 1/10/2020 paid 10 xyz 1/11/2020 10 xyz 1/12/2020 10 xyz 1/13/2020 10 abc 1/9/2020 borrow 12.5 abc 1/10/2020 12.5 abc 1/11/2020 unpaid 12.5 abc 1/12/2020 12.5 abc 1/13/2020 paid 12.5 What i want is to update the previous stage for each product key(based on the fact that the date is ascending order), please note that the stages are simplified here, they can be as many as 10-12 different stages. Result table should be like:
Product Key Date Stage Cost xyz 1/8/2020 borrow 10 xyz 1/9/2020 borrow 10 xyz 1/10/2020 paid 10 xyz 1/11/2020 paid 10 xyz 1/12/2020 paid 10 xyz 1/13/2020 paid 10 abc 1/9/2020 borrow 12.5 abc 1/10/2020 borrow 12.5 abc 1/11/2020 unpaid 12.5 abc 1/12/2020 unpaid 12.5 abc 1/13/2020 paid 12.5 Your help is really appreciated,
thanks,
- 110974865 years ago
Helper I
Hello, would a simple fill down in Power Query work?