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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
renatof
Most Valuable Professional
Most Valuable Professional

Multiple filter

Hi,

 

I have a situation like on the picture (WHAT I HAVE) PBI.png

 

So multiple values in each column. I need to find last address which was entered (last entry no.)

 

When I type formula 

Adrese = CALCULATETABLE(Table1;FILTER(Table1;Table1[Type] = "Address" && max(Table1[Entry_No])))

 

I got the red table which is not correct, and what I need is in the green table. 

 

I tried with calculated table, but the measure will be also fine, just to get last value based on type address and last entry no. 

 

Thanks,

Renato. 

1 ACCEPTED SOLUTION

Hi @renatof,

 

If you only to get the max Entry_No when the type is Address, please try this formula again.

 

Table 3 =
TOPN (
    1,
    SUMMARIZE (
        'Table1',
        Table1[Person_No],
        Table1[Value],
        'Table1'[Type],
        "max", CALCULATE (
            MAX ( 'Table1'[Entry_No] ),
            FILTER ( 'Table1', 'Table1'[Type] = "Address" )
        )
    ),
    [max], DESC
)

Capture.PNG

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @renatof,

 

By my test, you could have a try with this formula below.

 

Table 2 =
TOPN (
    CALCULATE (
        COUNT ( 'Table1'[Person_No] ),
        FILTER ( 'Table1', 'Table1'[Entry_No] = MAX ( 'Table1'[Entry_No] ) )
    ),
    'Table1',
    'Table1'[Entry_No], DESC
)

Then you will get the output.

 

Capture.PNG

 

Hope this can help you!

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
renatof
Most Valuable Professional
Most Valuable Professional

Hi,

 

this could work but column type I have multiple types so one more filter which is related to Table1[Type] = "Address" + last entry no. 

Hi @renatof,

 

If you only to get the max Entry_No when the type is Address, please try this formula again.

 

Table 3 =
TOPN (
    1,
    SUMMARIZE (
        'Table1',
        Table1[Person_No],
        Table1[Value],
        'Table1'[Type],
        "max", CALCULATE (
            MAX ( 'Table1'[Entry_No] ),
            FILTER ( 'Table1', 'Table1'[Type] = "Address" )
        )
    ),
    [max], DESC
)

Capture.PNG

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
renatof
Most Valuable Professional
Most Valuable Professional

Thank you. This is solution 🙂

Pulkit
Resolver I
Resolver I

Why don't you use the visual level filter? Select show only TOP N category and sort it on [Entory_No]

Aree
Resolver I
Resolver I

Have you tried 

Adrese = CALCULATETABLE(Table1;FILTER(Table1;Table1[Type] = "Address" ), Table1.Entry_No = max(Table1[Entry_No]))

 

Basically i split the two fliters. Without test data i cant simulate to be certain. 

renatof
Most Valuable Professional
Most Valuable Professional

Yes I tried with Adrese = CALCULATETABLE(Table1;FILTER(Table1;Table1[Type] = "Address");Table1[Entry_No] = MAX(Table1[Entry_No]))

 

and I got error A Function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed. 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.