Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello 🙂
I'm trying to track employee changes between 2 dates. I build measures to do this, and it works fine. but they are not dynamic with any slicers I want to add. Here is an example. I guess I'm just doing this wrong from the beginning, but I don't know how to handle this case.
| ID | Name | Date | Categorie | Region |
| 1 | Adam Lister | 2020-01 | Professional | South |
| 1 | Adam Lister | 2020-02 | IT | South |
| 1 | Adam Lister | 2020-03 | IT | South |
| 2 | Suzie White | 2020-03 | IT | North |
| 2 | Suzie White | 2020-04 | IT | North |
| 2 | Suzie White | 2020-05 | Professional | South |
| 3 | Mike Right | 2020-01 | Professional | South |
| 3 | Mike Right | 2020-03 | IT | North |
| 3 | Mike Right | 2020-04 | IT | North |
| 3 | Mike Right | 2020-05 | Professional | North |
Solved! Go to Solution.
Hi @ArmellA ,
Please refer to my pbix file to see if it helps you.
Create a table included the category column.
Create a measure.
Measure =
VAR _mindate =
MINX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[ID] = SELECTEDVALUE ( 'Table'[ID] ) ),
'Table'[Date]
)
VAR _1 =
MINX ( FILTER ( ALL ( 'Table' ), 'Table'[Date] = _mindate ), 'Table'[Region] )
VAR _maxdate =
MAXX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[ID] = SELECTEDVALUE ( 'Table'[ID] ) ),
'Table'[Date]
)
VAR _2 =
MINX (
FILTER (
ALL ( 'Table' ),
'Table'[Date] = _maxdate
&& 'Table'[ID] = SELECTEDVALUE ( 'Table'[ID] )
),
'Table'[Region]
)
VAR _re =
IF ( _1 = "South" && _2 = "North", 1, 0 )
RETURN
IF (
_re = 1
&& MAX ( 'Table'[Categorie] ) = SELECTEDVALUE ( 'Table (2)'[category] ),
1,
0
)
Then filter the measure is 1.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ArmellA
Please refer to attached sample file with the solution
From North to South =
SUMX (
VALUES ( Employee[ID] ),
VAR CurrentEmpTable = CALCULATETABLE ( Employee )
VAR FirstRegion = MAXX ( TOPN ( 1, CurrentEmpTable, Employee[Date], ASC ), Employee[Region] )
VAR LastRegion = MAXX ( TOPN ( 1, CurrentEmpTable, Employee[Date], DESC ), Employee[Region] )
RETURN
IF ( FirstRegion = "North" && LastRegion= "South", 1 )
)From South to North =
SUMX (
VALUES ( Employee[ID] ),
VAR CurrentEmpTable = CALCULATETABLE ( Employee )
VAR FirstRegion = MAXX ( TOPN ( 1, CurrentEmpTable, Employee[Date], ASC ), Employee[Region] )
VAR LastRegion = MAXX ( TOPN ( 1, CurrentEmpTable, Employee[Date], DESC ), Employee[Region] )
RETURN
IF ( FirstRegion = "South" && LastRegion= "North", 1 )
)
Hi @ArmellA
Please refer to attached sample file with the solution
From North to South =
SUMX (
VALUES ( Employee[ID] ),
VAR CurrentEmpTable = CALCULATETABLE ( Employee )
VAR FirstRegion = MAXX ( TOPN ( 1, CurrentEmpTable, Employee[Date], ASC ), Employee[Region] )
VAR LastRegion = MAXX ( TOPN ( 1, CurrentEmpTable, Employee[Date], DESC ), Employee[Region] )
RETURN
IF ( FirstRegion = "North" && LastRegion= "South", 1 )
)From South to North =
SUMX (
VALUES ( Employee[ID] ),
VAR CurrentEmpTable = CALCULATETABLE ( Employee )
VAR FirstRegion = MAXX ( TOPN ( 1, CurrentEmpTable, Employee[Date], ASC ), Employee[Region] )
VAR LastRegion = MAXX ( TOPN ( 1, CurrentEmpTable, Employee[Date], DESC ), Employee[Region] )
RETURN
IF ( FirstRegion = "South" && LastRegion= "North", 1 )
)
Hi @ArmellA ,
Please refer to my pbix file to see if it helps you.
Create a table included the category column.
Create a measure.
Measure =
VAR _mindate =
MINX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[ID] = SELECTEDVALUE ( 'Table'[ID] ) ),
'Table'[Date]
)
VAR _1 =
MINX ( FILTER ( ALL ( 'Table' ), 'Table'[Date] = _mindate ), 'Table'[Region] )
VAR _maxdate =
MAXX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[ID] = SELECTEDVALUE ( 'Table'[ID] ) ),
'Table'[Date]
)
VAR _2 =
MINX (
FILTER (
ALL ( 'Table' ),
'Table'[Date] = _maxdate
&& 'Table'[ID] = SELECTEDVALUE ( 'Table'[ID] )
),
'Table'[Region]
)
VAR _re =
IF ( _1 = "South" && _2 = "North", 1, 0 )
RETURN
IF (
_re = 1
&& MAX ( 'Table'[Categorie] ) = SELECTEDVALUE ( 'Table (2)'[category] ),
1,
0
)
Then filter the measure is 1.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 8 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 23 | |
| 16 | |
| 15 | |
| 14 | |
| 8 |