Forum Discussion
Calculated column for previous date values
Hi,
Looking for a way to extend the solution given by amitchandak and @v-deddai1-msft here - https://community.powerbi.com/t5/Desktop/Calculated-Column-for-previous-date-values/m-p/1056838#M494128
Need to calculate updates for all previous dates for a given task -
Today's update, yesterday's update, day before yesterday's update and so on...
- without creating the columns beforehand (as data will keep on appending)
sayali_deshmukh ,I would have prefered to test this. But data was not in text format
Create a column like
Date Name = Switch( True () ,
'Date'[Date]=TODAY(),"Today",
'Date'[Date]=TODAY()-1,"Yesterday",
'Date'[Date]=TODAY()-1,"Yesterday -1",
[Date]&"")Also create date desc rank
Date desc Rank = RANKX(ALL('Date'),'Date'[Date],,DESC,Dense)
Sort the first column on the second column
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
Have to measure or use max in matrix
Max Today Plan = max(Table[Today Plan])
Max Today Update= max(Table[Today Update])
On a Matrix Put Task on Row and Date name on column and these two as values and check
Hi sayali_deshmukh ,
Would you please check if the screenshot below meets your requirements?
For more details, please refer to pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EWhqoPlaynVOqoLGKqklSxsBBlKI3SAHzY93EPRObEQ17w?e=8VXXjE
Best Regards,
Dedmon Dai
5 Replies
- amitchandakSuper User
sayali_deshmukh , what kind of output you want ?
- sayali_deshmukhHelper III
DataTable -
Output -
For each task , updates of all dates previous to be visible -
Also, request you to suggest if there could be a better way to depict this info- amitchandakSuper User
sayali_deshmukh ,I would have prefered to test this. But data was not in text format
Create a column like
Date Name = Switch( True () ,
'Date'[Date]=TODAY(),"Today",
'Date'[Date]=TODAY()-1,"Yesterday",
'Date'[Date]=TODAY()-1,"Yesterday -1",
[Date]&"")Also create date desc rank
Date desc Rank = RANKX(ALL('Date'),'Date'[Date],,DESC,Dense)
Sort the first column on the second column
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
Have to measure or use max in matrix
Max Today Plan = max(Table[Today Plan])
Max Today Update= max(Table[Today Update])
On a Matrix Put Task on Row and Date name on column and these two as values and check