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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
larencib
New Member

How vlookup last use of transportation services

Hi, i am just new in PowerBi but have some experience en Powerpivot

I would like to find out in a table the last use of a Platfom (a long vehicle, with a NumberPlate po Matricula in spanish), and calculate in wich location is .This information comes from a table that shows all movements of the platforms betweens different islands

1.PNG

 

First, i tried to determine, from each  platforms, wich is the number  of use. After that i tried to max this use to determine its last service. But i dont know how to select the last PC_centro of this MAx Use

 

I tried this formulas:

 

 

Uso = COUNTROWS(FILTER('tblextraedatospedido';tblextraedatospedido[FechaTope]<=earlier('tblextraedatospedido'[FechaTope])&&'tblextraedatospedido'[_PC_Matricula]=earlier(tblextraedatospedido[_PC_Matricula])))

 

MaxUso = max(tblextraedatospedido[Uso])

 

And i tried some different calculation (vlookup to search wich PC-centro match with Max Uso but doesnt works

 

Thanks

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@larencib

 

According to your description, you want to get the last use PC_centro within each _po_Matricula. Right?

 

You can create a measure like below:

 

Last Use PC_centro =
VAR MaxDate =
    CALCULATE (
        MAX ( 'tblextraedatospedido'[FechaTope] ),
        ALLEXCEPT ( 'tblextraedatospedido', 'tblextraedatospedido'[_po_Matricula] )
    )
RETURN
    CALCULATE (
        MAX ( 'tblextraedatospedido'[PC_centro] ),
        FILTER ( 'tblextraedatospedido', 'tblextraedatospedido'[FechaTope] = MaxDate ),
        ALLEXCEPT ( 'tblextraedatospedido', 'tblextraedatospedido'[_po_Matricula] )
    )

Regards,

 

View solution in original post

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@larencib

 

According to your description, you want to get the last use PC_centro within each _po_Matricula. Right?

 

You can create a measure like below:

 

Last Use PC_centro =
VAR MaxDate =
    CALCULATE (
        MAX ( 'tblextraedatospedido'[FechaTope] ),
        ALLEXCEPT ( 'tblextraedatospedido', 'tblextraedatospedido'[_po_Matricula] )
    )
RETURN
    CALCULATE (
        MAX ( 'tblextraedatospedido'[PC_centro] ),
        FILTER ( 'tblextraedatospedido', 'tblextraedatospedido'[FechaTope] = MaxDate ),
        ALLEXCEPT ( 'tblextraedatospedido', 'tblextraedatospedido'[_po_Matricula] )
    )

Regards,

 

Many thanks, works perfectly !!!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.