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.
Hi,
I have the below table for which I would like to retrieve in a different column, the first date when the items were missing. The missing date should be retrieved only in the next row of the missing date, for which I have added the comments.
Many thanks for your support,
Melissa
Item | Date | Comments |
14544 | 02/10/2020 | |
14544 | 02/13/2020 | retrieve 02/11/2020 - the first date when the item was missing |
14544 | 02/14/2020 | |
14544 | 02/16/2020 | do not retrieve 02/15/2020 - is not the first dissapearence of the item |
14622 | 02/13/2020 | |
14622 | 02/15/2020 | retrieve 02/14/2020 - the first date when the item was missing |
14622 | 02/17/2020 | do not retrieve 02/16/2020 - is not the first dissapearence of the item |
14622 | 02/19/2020 | do not retrieve 02/18/2020 - is not the first dissapearence of the item |
Solved! Go to Solution.
Hi @Anonymous ,
Sorry i don't quite understand what you meaning "retrieve the next day of the first occurrence".
You want each row show mindate+1?
Or you want show mindate+1 when an item is appearing only once?
If i misunderstand your meaning, please show me what's the expected out put you want.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
I think you might encounter some issues if it not always the second day which is missing. If so then you can tweek @v-jayw-msft 's great solution like below:
Column =
var mindate = CALCULATE(MIN('Fact'[Date]);ALLEXCEPT('fact';'fact'[Item]))
var maxdate = MAX( TODAY(); CALCULATE(MAX('Fact'[Date]);ALLEXCEPT('fact';'fact'[Item])))
return
MINX(
FILTER(
ALL('Calendar');
'Calendar'[Date] in DATESBETWEEN( 'Calendar'[Date]; mindate; maxdate) && NOT('Calendar'[Date] IN CALCULATETABLE( SELECTCOLUMNS( 'Fact'; "Date"; 'Fact'[Date]); ALLEXCEPT( 'Fact'; 'Fact'[Item])))
);
'Calendar'[Date]
)
Kudos is highly appreciated.
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 |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |