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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Boycie92
Resolver I
Resolver I

Transforming Data

Hi,

 

I am looking for some advice.

 

I want to be able to transform data that looks like this:

 

Building

Date

Task

Status

Building 1

Lock Doors

01/01/2020

Done

Building 1

Hover

01/02/2020

Not Done

Building 2

Empty bins

02/01/2020

Nor Done

 

Into this:

Building

Task

Previous Date

Previous Status

Current Date

Current Status

Building 1

Lock Doors

01/01/2020

Done

06/04/2020

Done

Building 1

Hover

01/02/2020

Not Done

07/04/2020

Not Done

Building 2

Empty bins

02/01/2020

Nor Done

08/04/2020

Done

 

Essentially, I have a number of buildings. In each building there are various task to do. I want to be able to see the Current and Previous Status (using the Date) of a task, to see if it was done or not.

 

Does anyone have any suggestions on how to get it into this format using either Power Query or DAX?

 

Thanks,

Boycie92

5 REPLIES 5
v-luwang-msft
Community Support
Community Support

Hi @Boycie92 ,

Can you provide the specific formula for calculating Current Date and Current Status?

 

Best Regards

Lucien

HI @v-luwang-msft 

 

I don't have any. I was hoping the community could help with that? and the previous formulas?

amitchandak
Super User
Super User

@Boycie92 , Your data is not relating to the first table.

 

Usually in dax new column , you can get previous status and date like

previous date = maxx(filter(Table, [Building] =earlier([Building]) && [Date] <earlier([date])),[Date])

previous Status= maxx(filter(Table, [Building] =earlier([Building]) && [Date] = earlier([previous date])),[Status])

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
Anonymous
Not applicable

Hi,

I don't see where you would get the current dates from in the upper table. Can you not add them in your data source and then import it to Excel? Without any consistent pattern in those dates I don't think PBI is the right tool to add another column to your dataset.

Regards,

Jasper

Hi @Anonymous 

 

That is part of the problem I would need (somehow) to be able to idenity the current date based on the last date entry for a sepcific task that relates to a building.

 

Thanks,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.