Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

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!

  • 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])))

2 Replies

  • 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's avatar
      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. :smileymad:

       

      Thanks for your help