Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sayali_deshmukh
Helper III
Helper III

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#M494...

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)



2 ACCEPTED SOLUTIONS

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Hi @sayali_deshmukh ,

 

Would you please check if the screenshot below meets your requirements?

Untitled picture.png

For more details, please refer to pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EWhqoPlaynVOqoLGKq...

 

Best Regards,

Dedmon Dai

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@sayali_deshmukh , what kind of output you want ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

DataTable - 
D1.PNG

Output - 
For each task , updates of all dates previous to be visible -


O1.PNG
Also, request you to suggest if there could be a better way to depict this info

 

Hi @sayali_deshmukh ,

 

Would you please check if the screenshot below meets your requirements?

Untitled picture.png

For more details, please refer to pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EWhqoPlaynVOqoLGKq...

 

Best Regards,

Dedmon Dai

Hi @v-deddai1-msft 
Thank you for your help.
I was able to get the output as per your suggestion.

Also, looking for a way to show the same data in following view - 

TaskDate05-05-202004-05-202003-05-2020
Module1PlanDeployUpdationModification
 UpdateDoneDoneDone






@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors