Forum Discussion

fedeleu's avatar
fedeleu
Frequent Visitor
5 years ago
Solved

Form Table with Historical Data

Nice day Every day I receive a .txt file with computers that need to be repaired. As relevant data is the date of entry, date of the report and ID_equipo. New revenue can be added every day, but if ...
  • v-yingjl's avatar
    v-yingjl
    5 years ago

    Hi fedeleu ,

    Based on your description, you can create a calculated table like this:

    Cumulative Table = 
    VAR tab =
        UNION ( 'Day 1', 'Day 2' )
    VAR tb =
        ADDCOLUMNS (
            FILTER (
                tab,
                [Report_Date]
                    = MINX (
                        FILTER ( tab, [ID_Product] = EARLIER ( 'Day 1'[ID_Product] ) ),
                        [Report_Date]
                    )
            ),
            "Repaired Date",
                IF (
                    NOT ( 'Day 1'[ID_Product] IN DISTINCT ( 'Day 2'[ID_Product] ) ),
                    MAXX ( tab, [Report_Date] ),
                    BLANK ()
                )
        )
    RETURN
        tb

    Attached a sample file in the below, hopes to help you.

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.