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
getpho92
New Member

HELP getting Latest Information - Dax Command

So i'm runing 2 queries 1 with data that is in a staging status, another that is constantly being updated and the name may be different dependent on the most recent transaction. I currently have a formula for this column but it isn't following the latest logic as i want it to. I essentially want a XLOOKUP looking at the most recent transaction. I tried to create the query with Order by but seems like Dax is looking at earliest transaction not top to bottom logic. Here is the coding im using and screenshot of the two tables im looking at:

 

As you can see Maura is the name i want it to show but it keeps showing Rigoberto instead....


Here is the Dax command for table [name]:

name = CALCULATE(MAX(Query1[name]),FILTER(Query1,Query1[Location]=EARLIEST(Picked[LastCart])))


Here is table Query 1:

getpho92_0-1667116984738.png

Table 2: Picked

getpho92_1-1667117035051.png

 

3 REPLIES 3
v-jialluo-msft
Community Support
Community Support

Hi @getpho92 ,

Please follow these steps:

1.Create a measure to find the latest name

 

Lates name =
VAR _location =
    MAX ( 'Table'[Lastcart] )
VAR _time =
    MAXX (
        FILTER ( ALL ( 'Query 1' ), 'Query 1'[Location] = _location ),
        'Query 1'[Time stemp]
    )
VAR _name =
    MAXX (
        FILTER (
            ALL ( 'Query 1' ),
            'Query 1'[Location] = _location
                && 'Query 1'[Time stemp] = _time
        ),
        'Query 1'[name]
    )
RETURN
    _name

 

 

 

 

2.Final output
vjialluomsft_0-1667205005846.png

 

Best Regards,

Gallen Luo

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @getpho92 

please try

name =
MAXX (
    FILTER ( Picked, Picked[LastCart] = Query1[Location] ),
    Picked[Packer Name]
)

When i attempt to do Picked[LastCart] = Query1[Location] i retrieve an error everytime, is this something wrong with the filtering?

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.