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
jd8766
Helper II
Helper II

Get latest value from FACT table?

Hi, I have a customer dimension structured like the below

jd8766_0-1690915629164.png


I have a FACT table like the below (joined using CustomerKey)

jd8766_1-1690915749083.png



I want to add a column to my customer dimension table which gets me the latest Product Name, and Order Date from the FACT table where OrderComplete = 0. It should get me the one that has the latest Order date...So this would give me an output of the below

jd8766_2-1690915890412.png

How could I build this calculated column using DAX?
Thanks

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

LatestProductName =
MAXX(
    TOPN(
        1,
        FILTER( RELATEDTABLE( 'FACT' ), 'FACT'[OrderComplete] = 0 ),
        'FACT'[OrderDate]
    ),
    'FACT'[ProductName]
)
LatestProductDate =
CALCULATE( LASTDATE( 'FACT'[OrderDate] ), 'FACT'[OrderComplete] = 0 )

ThxAlot_0-1690920724566.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

LatestProductName =
MAXX(
    TOPN(
        1,
        FILTER( RELATEDTABLE( 'FACT' ), 'FACT'[OrderComplete] = 0 ),
        'FACT'[OrderDate]
    ),
    'FACT'[ProductName]
)
LatestProductDate =
CALCULATE( LASTDATE( 'FACT'[OrderDate] ), 'FACT'[OrderComplete] = 0 )

ThxAlot_0-1690920724566.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try creating a these measures:

 

Measure= CALCULATE(VALUES(Transactions[Product Name]),USERELATIONSHIP(Customer[Customer Key],Transactions[Customer Key]),LASTDATE(Transactions[Order Date]))
 
Measure 2 = CALCULATE(VALUES(Transactions[Order Date]),USERELATIONSHIP(Customer[Customer Key],Transactions[Customer Key]),LASTDATE(Transactions[Order Date]))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
 
 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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