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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.