Forum Discussion

ReadTheIron's avatar
ReadTheIron
Helper III
4 years ago
Solved

Creating text column with values from two related tables

I'm trying to create a text column displaying information from two related tables:

Asset List
AssetFullLatest Failure
Asset11/2/2021
Asset23/6/2021
Asset34/10/2021

 and

Daily Reports
AssetFullAsset ID
Asset11
Asset22
Asset11
Asset33

 

They have a many-to-one relationship, Daily Reports to Asset List. I'm trying to create a text column that displays Asset ID and Latest Failure. 

Asset List
AssetFullLatest FailureIDDate
Asset11/2/20211: 1/2/21
Asset23/6/20212: 3/6/21
Asset34/10/20213: 4/10/21

 

I've tried IDDate = FILTER(RELATED('Daily Reports'),'Asset List'[AssetFull])) & ":" & 'Asset List'[Latest Failure], but this gives me a syntax error.

 

Relatedly, when I was testing this with values in the same table, the date value displayed as the full date/time (Asset1: 01/02/2021 12:00 AM) - is there a way to display only the short date in the new column?

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  ReadTheIron ,

    Here are the steps you can follow:

    1. Create calculated column.

    Date =
    VAR _1=CALCULATE(MAX('Daily Reports'[Asset ID]),FILTER(ALL('Daily Reports'),'Daily Reports'[AssetFull]=EARLIER('Asset List'[AssetFull])))
    return
    _1&":"&[Latest Failure]

    2. Result:

     

    Best Regards,

    Liu Yang

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

3 Replies