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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.