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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
BrianVT
Resolver I
Resolver I

Column Function To Evaluate Current Row Against Later Row (Next Period)

The following is sample data and would have rows with several years of monthly pulls of a roster and what Org (think department) every employee is in as of the end of each month.  I want to create a column (shown as "Status Change") that evaluates each row against that same person in the next month to see if their Org changed or if they disappeared completely from the list.  "Re-Alignment" would mean that their Org changes in the next period and "Departed" means it was their last month with the company since they were not on the roster in the next period.  Blanks can be given for everything else.

 

File DateNameOrg Tier 1Status Change
10/31/2018Smith, John4.0 
11/30/2018Smith, John4.0 
12/31/2018Smith, John4.0 
1/31/2019Smith, John4.0 
2/28/2019Smith, John4.0 
3/31/2019Smith, John4.0 
4/30/2019Smith, John4.0 
5/31/2019Smith, John4.0Re-alignment
6/30/2019Smith, John8.0 
7/31/2019Smith, John8.0 
8/31/2019Smith, John8.0 
9/30/2019Smith, John8.0 
10/31/2019Smith, John8.0 
11/30/2019Smith, John8.0Departed

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@BrianVT 

pls try to create a column

Column = 
var org= MINX(FILTER(Sheet1,Sheet1[Name]=EARLIER(Sheet1[Name])&&'Sheet1'[File Date]>EARLIER(Sheet1[File Date])),Sheet1[Org Tier 1])
var _date=MAXX(FILTER(Sheet1,Sheet1[Name]=EARLIER(Sheet1[Name])),Sheet1[File Date])
return if(_date=Sheet1[File Date],"Departed",if(org=Sheet1[Org Tier 1],"","Re-alignment"))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@BrianVT 

pls try to create a column

Column = 
var org= MINX(FILTER(Sheet1,Sheet1[Name]=EARLIER(Sheet1[Name])&&'Sheet1'[File Date]>EARLIER(Sheet1[File Date])),Sheet1[Org Tier 1])
var _date=MAXX(FILTER(Sheet1,Sheet1[Name]=EARLIER(Sheet1[Name])),Sheet1[File Date])
return if(_date=Sheet1[File Date],"Departed",if(org=Sheet1[Org Tier 1],"","Re-alignment"))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks, Ryan - So that column function includes two measures that I need to create first?

@BrianVT 

That's one measure of column.

you can learn more about VAR function here

https://docs.microsoft.com/en-us/dax/var-dax

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Wow, that's amazing.  I've never used thosed within column functions before.  Thank you very much!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.