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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Last Date Modified (Column vs Column)

Hello,

 

I have a data set with items and their contract price. These contracts are modified by either the branch or the corporate headquarters. These are each in different columns. I would like to pull the last time the item was modified, regardless of where it was modified. ie, given the sample data, I want to create that last column in BI where it picks the last date between the two.

 

ItemLast Modified - CorporateLast Modified - BranchLast Modified
A10/1/2014 10/1/2014
B12/3/2013 12/3/2013
C1/15/20153/8/20141/15/2015
D3/4/20124/9/20134/9/2013
E5/10/20156/10/20145/10/2015
F 5/10/20135/10/2013
G 10/5/201510/5/2015

 

Thanks for any help!

1 ACCEPTED SOLUTION
th3h0bb5
Resolver II
Resolver II

You should be able to do this with a nested IF statement to see which column has the older date. The first two IF statements check to see if the column is blank. If they are, it returns the other column. The final IF statement compares the two columns if they're not blank and gives you the older one.

 

lastMod = IF(ISBLANK([Last Modified - Branch]),[Last Modified - Corporate], IF(ISBLANK(Table1[Last Modified - Corporate]),[Last Modified - Branch], IF([Last Modified - Branch]<=[Last Modified - Corporate],[Last Modified - Branch], [Last Modified - Corporate])))

View solution in original post

2 REPLIES 2
th3h0bb5
Resolver II
Resolver II

You should be able to do this with a nested IF statement to see which column has the older date. The first two IF statements check to see if the column is blank. If they are, it returns the other column. The final IF statement compares the two columns if they're not blank and gives you the older one.

 

lastMod = IF(ISBLANK([Last Modified - Branch]),[Last Modified - Corporate], IF(ISBLANK(Table1[Last Modified - Corporate]),[Last Modified - Branch], IF([Last Modified - Branch]<=[Last Modified - Corporate],[Last Modified - Branch], [Last Modified - Corporate])))

Anonymous
Not applicable

@th3h0bb5

I had tried that and it didn't work... Turns out one of my date categories was formatted as a text. Smiley Mad

 

Thanks for your help

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.