Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi,
I have such data:
KetID | StID | TypeID | TypeLevel | YesNo | Date | RecentLevel |
K12 | 23 | a322 | 1 | Yes | 7/14/2021 | 1 |
K12 | 23 | a322 | 1 | No | 6/14/2021 | 0 |
K12 | 23 | a333 | 3 | Yes | 7/14/2021 | 1 |
K12 | 23 | a333 | 3 | No | 6/14/2021 | 0 |
K12 | 23 | a333 | 3 | Yes | 7/14/2021 | 1 |
K12 | 23 | a444 | 2 | Yes | 6/11/2021 | 0 |
K12 | 23 | a444 | 2 | No | 7/11/2021 | 1 |
K12 | 22 | a73a | 1 | Yes | 6/11/2021 | 1 |
K12 | 22 | a73a | 1 | Yes | 7/11/2021 | 1 |
K12 | 22 | a63a | 2 | Yes | 3/11/2021 | 1 |
K12 | 22 | a63a | 2 | Yes | 5/11/2021 | 1 |
K13 | 23 | a322 | 1 | No | 7/14/2021 | 1 |
K13 | 23 | a322 | 1 | No | 6/14/2021 | 1 |
K13 | 23 | a333 | 3 | Yes | 7/14/2021 | 0 |
K13 | 23 | a333 | 3 | No | 6/14/2021 | 1 |
K13 | 23 | a333 | 3 | NA | 7/14/2021 | 2 |
K13 | 23 | a444 | 2 | No | 3/11/2021 | 0 |
K13 | 23 | a444 | 2 | Yes | 7/11/2021 | 1 |
K13 | 22 | a73a | 1 | Yes | 6/11/2021 | 1 |
K13 | 22 | a73a | 1 | Yes | 7/11/2021 | 1 |
K13 | 22 | a63a | 2 | No | 3/11/2021 | 0 |
K13 | 22 | a63a | 2 | Yes | 5/11/2021 | 1 |
I use KetID as slicer.
I want to see the most recent TypeID by looking at the date. If there is a repeated value (which is always the same), I want to see only one of them.
If I select K12, the result should be:
KetID | StID | TypeID | TypeLevel | YesNo | Date | RecentLevel |
K12 | 23 | a322 | 1 | Yes | 7/14/2021 | 1 |
K12 | 23 | a333 | 3 | Yes | 7/14/2021 | 1 |
K12 | 23 | a444 | 2 | No | 7/11/2021 | 1 |
K12 | 22 | a73a | 1 | Yes | 7/11/2021 | 1 |
K12 | 22 | a63a | 2 | Yes | 5/11/2021 | 1 |
If I select K13, the result should be:
KetID | StID | TypeID | TypeLevel | YesNo | Date | RecentLevel |
K13 | 23 | a322 | 1 | No | 7/14/2021 | 1 |
K13 | 23 | a333 | 3 | NA | 7/14/2021 | 2 |
K13 | 23 | a444 | 2 | Yes | 7/11/2021 | 1 |
K13 | 22 | a73a | 1 | Yes | 7/11/2021 | 1 |
K13 | 22 | a63a | 2 | Yes | 5/11/2021 | 1 |
Thanks in advance!
Solved! Go to Solution.
Hi @IF ,
Create the following measure and put it into Filters, set show items when the value is 1.
Measure =
VAR _date =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( ALLSELECTED ( 'Table' ), [TypeID] = MAX ( 'Table'[TypeID] ) )
)
VAR _rank =
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), [TypeID] = MAX ( 'Table'[TypeID] ) ),
CALCULATE ( SUM ( 'Table'[RecentLevel] ) ),
,
DESC,
DENSE
)
RETURN
IF ( _date = MAX ( 'Table'[Date] ) && _rank = 1, 1 )
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @IF ,
Create the following measure and put it into Filters, set show items when the value is 1.
Measure =
VAR _date =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( ALLSELECTED ( 'Table' ), [TypeID] = MAX ( 'Table'[TypeID] ) )
)
VAR _rank =
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), [TypeID] = MAX ( 'Table'[TypeID] ) ),
CALCULATE ( SUM ( 'Table'[RecentLevel] ) ),
,
DESC,
DENSE
)
RETURN
IF ( _date = MAX ( 'Table'[Date] ) && _rank = 1, 1 )
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
42 | |
30 | |
27 | |
26 |