Forum Discussion

jd8766's avatar
jd8766
Icon for Helper II rankHelper II
3 years ago
Solved

Get latest value from FACT table?

Hi, I have a customer dimension structured like the below I have a FACT table like the below (joined using CustomerKey) I want to add a column to my customer dimension tab...
  • ThxAlot's avatar
    3 years ago
    LatestProductName =
    MAXX(
        TOPN(
            1,
            FILTER( RELATEDTABLE( 'FACT' ), 'FACT'[OrderComplete] = 0 ),
            'FACT'[OrderDate]
        ),
        'FACT'[ProductName]
    )
    LatestProductDate =
    CALCULATE( LASTDATE( 'FACT'[OrderDate] ), 'FACT'[OrderComplete] = 0 )