Forum Discussion
Filling Blank Dates Challange
Hello Friends,
I am having data like this,
| ReportDate | PO | Date |
| 07-08-2024 | 1 | 07-05-2024 |
| 07-08-2024 | 2 | 07-02-2024 |
| 07-08-2024 | 3 | 07-01-2024 |
| 07-08-2024 | 4 | 07-03-2024 |
| 07-08-2024 | 5 | 07-04-2024 |
| 07-15-2024 | 1 | 07-11-2024 |
| 07-15-2024 | 2 | |
| 07-15-2024 | 3 | 07-10-2024 |
| 07-15-2024 | 4 | |
| 07-15-2024 | 5 | |
| 07-23-2024 | 1 | 07-18-2024 |
| 07-23-2024 | 2 | |
| 07-23-2024 | 3 | |
| 07-23-2024 | 4 | |
| 07-23-2024 | 5 |
However, i want to show most revised date value in the place of blanks based on PO,
Is there any way to achieve this using DAX while incorporating calculated column?
Desired output is as shown below -
| ReportDate | PO | Date |
| 07-08-2024 | 1 | 07-05-2024 |
| 07-08-2024 | 2 | 07-02-2024 |
| 07-08-2024 | 3 | 07-01-2024 |
| 07-08-2024 | 4 | 07-03-2024 |
| 07-08-2024 | 5 | 07-04-2024 |
| 07-15-2024 | 1 | 07-11-2024 |
| 07-15-2024 | 2 | 07-02-2024 |
| 07-15-2024 | 3 | 07-10-2024 |
| 07-15-2024 | 4 | 07-03-2024 |
| 07-15-2024 | 5 | 07-04-2024 |
| 07-23-2024 | 1 | 07-18-2024 |
| 07-23-2024 | 2 | 07-02-2024 |
| 07-23-2024 | 3 | 07-10-2024 |
| 07-23-2024 | 4 | 07-03-2024 |
| 07-23-2024 | 5 | 07-04-2024 |
- Anonymous2 years ago
Thanks for the reply from Ashish_Mathur and NaveenGandhi , please allow me to provide another insight:
Hi, PowerRobots99
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2. Below are the measure I've created for your needs:
MEASURE = VAR cc = MAX ( 'Table'[Dates] ) VAR bb = CALCULATE ( MAX ( 'Table'[ReportDate] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[PO] = MAX ( 'Table'[PO] ) && 'Table'[ReportDate] < MAX ( 'Table'[ReportDate] ) ) ) VAR aa = CALCULATE ( MAX ( 'Table'[Dates] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[PO] = MAX ( 'Table'[PO] ) && 'Table'[ReportDate] = bb ) ) RETURN IF ( ISBLANK ( cc ), aa, cc )3.Here's my final result, which I hope meets your requirements.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
10 Replies
- Ashish_Mathur
Super User
Hi,
This calculated column formula works
Column = COALESCE(CALCULATE(MAX(Data[Date]),FILTER(Data,Data[PO]=EARLIER(Data[PO])&&Data[ReportDate]<EARLIER(Data[ReportDate]))),Data[Date])Hope this helps.
- PowerRobots99
Helper II
Thank you for your reply,
Could you please share .pbix file, many thanks..
- Ashish_Mathur
Super User
You are welcome. I have already shared the formula. I do not have the PBI file.
- NaveenGandhi
Memorable Member
@Hi PowerRobots99
Can you share more detail on how you choose the most revised dates? You might need to explain how to choose those dates with some sample data and screenshot.
Regards,
NG- PowerRobots99
Helper II
Thank you for your reply,
Please refer attached screenshot,
Dates should be calculated in place of blanks based on its corresponding PO numbers in previous report dates,