Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
1 year ago
Solved

Get Last Values from a Table

Hello. From my CRM I am obtaining information that I must graph. I need to have for each customer the latest value for various attributes. Working with the information I finally have a table that co...
  • bhanu_gautam's avatar
    1 year ago

    Syndicate_Admin 

    Create a Calculated Column to Identify the Latest Record:

    LatestRecord =
    RANKX(
    FILTER(
    TableName,
    TableName[accountid] = EARLIER(TableName[accountid]) &&
    TableName[attribute] = EARLIER(TableName[attribute])
    ),
    TableName[createdon],
    ,
    DESC
    )

     

    Then, you can create a filtered table or measure to get only the latest records where the rank is 1.

    LatestValuesTable =
    FILTER(
    TableName,
    TableName[LatestRecord] = 1
    )