The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I have a set of data where a certain value appears multiple times. I want to know the date that the previous value appeared to the current date. Example below of data.
Name | Date |
Blue | 1/1/2022 |
Red | 8/4/2021 |
Blue | 5/1/2021 |
Blue | 4/2/2021 |
Green | 4/1/2021 |
Green | 2/3/2021 |
Example of what I need for results:
Name | Date | Previous Date |
Blue | 1/1/2022 | 5/1/2021 |
Red | 8/4/2021 | null |
Blue | 5/1/2021 | 4/2/2021 |
Blue | 4/2/2021 | null |
Green | 4/1/2021 | 2/3/2021 |
Green | 2/3/2021 | null |
Any help would be greatly appreciated. Thank you in advance!
Solved! Go to Solution.
A new column
maxx(filter(Table, [Name] =earlier([Name]) && [Date] <earlier([Date]) ) , [Date])
A new column
maxx(filter(Table, [Name] =earlier([Name]) && [Date] <earlier([Date]) ) , [Date])
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |