Forum Discussion
Track date value changes and store new values in table
- 4 years ago
Hi JeroenHD
Power BI is used to analyze data, not create data, it means if data changed in your Data Source, then data in Power BI will also change accordingly after you click on refresh button. So if you want to analyze the difference between them, you need to create a new column or new table in your Data Source.
After you add changes to your datasource, then you can create columns bellow,
CHANGED DATE 1 = var _predate=RANKX(FILTER(ALL('Table'),'Table'[LINE_NO]=EARLIER('Table'[LINE_NO]) && 'Table'[PURC_ORDER_ID] = EARLIER('Table'[PURC_ORDER_ID])),'Table'[PROMISED DATE],,ASC) return IF(_predate=2,'Table'[PROMISED DATE])CHANGED DATE 2 = var _predate=RANKX(FILTER(ALL('Table'),'Table'[LINE_NO]=EARLIER('Table'[LINE_NO]) && 'Table'[PURC_ORDER_ID] = EARLIER('Table'[PURC_ORDER_ID])),'Table'[PROMISED DATE],,ASC) return IF(_predate=3,'Table'[PROMISED DATE])result
If you need measures,
measure CHANGED DATE 1 = var _predate=RANKX(FILTER(ALL('Table'),'Table'[LINE_NO]=MIN('Table'[LINE_NO]) && 'Table'[PURC_ORDER_ID] = MIN('Table'[PURC_ORDER_ID])),CALCULATE(MIN('Table'[PROMISED DATE])),,ASC) return IF(_predate=2,MIN('Table'[PROMISED DATE]))measure CHANGED DATE 2 = var _predate=RANKX(FILTER(ALL('Table'),'Table'[LINE_NO]=MIN('Table'[LINE_NO]) && 'Table'[PURC_ORDER_ID] = MIN('Table'[PURC_ORDER_ID])),CALCULATE(MIN('Table'[PROMISED DATE])),,ASC) return IF(_predate=3,MIN('Table'[PROMISED DATE]))Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hello Amitchandak,
Should have explained it better. Which is an art itself it seems:-).
The data comes from an SQL database. I would like to know that if a date on a row is changed what the new date is compared to the previous entry.
Does that make any sense?
Kind regards,
Jeroen
JeroenHD , there two blog, see if that can help.
https://medium.com/@sam.mckay/show-changes-over-time-in-power-bi-reports-b3e621316cff
https://exceed.hr/blog/how-to-track-changes-in-the-table-in-power-query/
- JeroenHD4 years ago
Helper I
Thanks amitchandak , will check them out today and let you know.