Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello, I want to be able to retrieve the value of Date1 of the previous Column1 = empty.
The result I want is in the 3rd column identified by the red arrow. As you can see, the result can repeat itself since it will search the previous empty colum1 value.
Thank you
Solved! Go to Solution.
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.
can you provide some dummy data in text form?
Proud to be a Super User!
Hello, the data is the first 2 columns of the print screen. Thank you
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?
Proud to be a Super User!
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
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.
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,
Hello, would a simple fill down in Power Query work?
It works perfectly! Thank you!
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!
I tried with CALCULATE but it doesn't work with string. I unfortunately wasn't able to find a solution...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
105 | |
69 | |
67 | |
43 |
User | Count |
---|---|
148 | |
103 | |
103 | |
88 | |
66 |