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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Daretoexplore
Advocate I
Advocate I

Random question

Hi all

 

I have a weird situation, and Im not sure how to tackle it.

 

My data is as follows:

 

Name.                Category.        Date

Anne Other.        Banana.          1st Feb

Anne Other.        Banana.          2nd Feb

Anne Other.        Apple.            30th Jan

John Smith.        Banana.           30th Jan

John Smith.        Banana.          2nd Feb

 

Im wondering if there's is a way to create a column that marks the latest row for each individual name, for each individual category, so in this example rows 2,3 and 5 would receive the marker where the others wouldn't.

 

Is there a way because Im tempted to say its impossible!

 

Many thanks

 

 

1 ACCEPTED SOLUTION
cengizhanarslan
Super User
Super User

You could create a calculated column as below:

Is Latest Row =
VAR CurrName = 'Table'[Name]
VAR CurrCat  = 'Table'[Category]
VAR CurrDate = 'Table'[Date]
VAR MaxDateForPair =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Name] = CurrName && 'Table'[Category] = CurrCat
        )
    )
RETURN
IF ( CurrDate = MaxDateForPair, 1, 0 )
_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

View solution in original post

3 REPLIES 3
krishnakanth240
Super User
Super User

Hi @Daretoexplore 

 

I have tried with calculated column from sample data. Can you give a try from the image and confirm. Thank You!

krishnakanth240_0-1768311088007.png

 

 

cengizhanarslan
Super User
Super User

You could create a calculated column as below:

Is Latest Row =
VAR CurrName = 'Table'[Name]
VAR CurrCat  = 'Table'[Category]
VAR CurrDate = 'Table'[Date]
VAR MaxDateForPair =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Name] = CurrName && 'Table'[Category] = CurrCat
        )
    )
RETURN
IF ( CurrDate = MaxDateForPair, 1, 0 )
_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

Thank you so much!!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors