Forum Discussion

mmunozjr5's avatar
mmunozjr5
Frequent Visitor
1 year ago
Solved

Identifying only records that changed

I have the following table in Power BI, this table gets its data from Excel files stored in a folder that contains daily extracts from a source system. Sometimes users change records in the source sy...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, mmunozjr5 

     

    You can try the following methods. Make a judgment about whether there is a change for each column.

    Category change = 
    Var _count1=CALCULATE(COUNT('Table'[Order number]),ALLEXCEPT('Table','Table'[Order number]))
    Var _count2=CALCULATE(COUNT('Table'[Category]),ALLEXCEPT('Table','Table'[Category],'Table'[Order number]))
    RETURN
    IF(_count1=_count2,BLANK(),"Category")
    Date = DATE(RIGHT(LEFT([Source.Name],10),4),RIGHT(LEFT([Source.Name],12),2),RIGHT(LEFT([Source.Name],14),2))

    New table:

    New table = FILTER(SUMMARIZE('Table','Table'[Order number],'Table'[Category change]),[Category change]<>BLANK())

    Column:

    Change date = CALCULATE(MAX('Table'[Date]),FILTER('Table',[Order number]=EARLIER('New table'[Order number])))
    NewValue = CALCULATE(MAX('Table'[Category]),FILTER('Table',[Order number]=EARLIER('New table'[Order number])&&[Date]=EARLIER('New table'[Change date])))
    OldValue = CALCULATE(MAX('Table'[Category]),FILTER('Table',[Order number]=EARLIER('New table'[Order number])&&[Date]=MIN('Table'[Date])))

    Is this the result you expected?

     

    Best Regards,

    Community Support Team _Charlotte

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