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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Applicable88
Impactful Individual
Impactful Individual

Filter table with calculated table

Hello, 

my original table:

 

Category  Date Name
A 25.01.2022 Pan
B 25.01.2022 Hook
A 24.01.2022 Hook
B 24.01.2022 Pan 
A 23.01.2022 Pan 
B 23.01.2022 Hook

 

How to make a calculated table which in any case always only shows the newest date for both categories ? 

 

Expected outcome like this:

Category  Date Name
A 25.01.2022 Pan
B 25.01.2022 Hook

 

I tried addcolumns with summarize and calculated max for date and name. It might works for date but somehow there is no context tranisition for the name. Instead it will show the name with the "higher" alphabet.  The name can be wrong. 

Thank you very much in advance.

Best. 

2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @Applicable88 
For table you can use

Last Data = 
VAR DataWithLastDatePerCategory =
    ADDCOLUMNS ( 
        Data,
        "@LastDate",
        VAR CategoryTable =
            CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Category ] ) )
        RETURN
            MAXX ( 
                CategoryTable,
                Data[Date]
            )
    )
VAR Result =
    FILTER ( DataWithLastDatePerCategory, Data[Date] = [@LastDate] )
RETURN
    SELECTCOLUMNS ( Result, "Category", [Category ], "Date", [Date], "Name", [Name] )

 

for Calculated column you can use

Name On Last Date = 
VAR CategoryTable =
    CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Category ] ) )
VAR MaxDate =
    MAXX ( 
        CategoryTable,
        Data[Date]
    )
VAR Result =
    MAXX (
        FILTER ( CategoryTable, Data[Date] = MaxDate ),
        Data[Name]
    )
RETURN
    Result 

View solution in original post

BeaBF
Super User
Super User

@Applicable88 Try with:

 

= FILTER (
Tabella,
Tabella[Date]
= CALCULATE (
MAX ( Tabella[Date] ),
ALLEXCEPT ( Tabella, Tabella[Category ] )
)
)
 
B.

View solution in original post

2 REPLIES 2
BeaBF
Super User
Super User

@Applicable88 Try with:

 

= FILTER (
Tabella,
Tabella[Date]
= CALCULATE (
MAX ( Tabella[Date] ),
ALLEXCEPT ( Tabella, Tabella[Category ] )
)
)
 
B.
tamerj1
Super User
Super User

Hi @Applicable88 
For table you can use

Last Data = 
VAR DataWithLastDatePerCategory =
    ADDCOLUMNS ( 
        Data,
        "@LastDate",
        VAR CategoryTable =
            CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Category ] ) )
        RETURN
            MAXX ( 
                CategoryTable,
                Data[Date]
            )
    )
VAR Result =
    FILTER ( DataWithLastDatePerCategory, Data[Date] = [@LastDate] )
RETURN
    SELECTCOLUMNS ( Result, "Category", [Category ], "Date", [Date], "Name", [Name] )

 

for Calculated column you can use

Name On Last Date = 
VAR CategoryTable =
    CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Category ] ) )
VAR MaxDate =
    MAXX ( 
        CategoryTable,
        Data[Date]
    )
VAR Result =
    MAXX (
        FILTER ( CategoryTable, Data[Date] = MaxDate ),
        Data[Name]
    )
RETURN
    Result 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.