cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
rlee1982
Helper III
Helper III

Automatically update a column when a value in another column exist more than once

 

Dear all

 

I have a log table to record each action ("Action" column), when it happen ("Log_Time" column), and its meaning ("Process" column).

 

My target is to automatically update the "Process" column when there is a new action happen after the previous action. 

 

Below is an example:

 

Action A, B, and C happened again, so the process start over after the latest Action A.

 

Action

Log_TimeProcess
Action A1/1/2022Start of Process A
Action B2/1/2022Start of Process B
Action C3/1/2022Start of Process C
Action D3/15/2022Start of Process D
Action E4/1/2022Start of Process E
Action A5/1/2022 
Action B5/4/2022 
Action C5/15/2022 

 

 

Action

Log_TimeProcess
Action A1/1/2022 
Action B2/1/2022 
Action C3/1/2022 
Action D3/15/2022 
Action E4/1/2022 
Action A5/1/2022Start of Process A
Action B5/4/2022Start of Process B
Action C5/15/2022Start of Process C

 

Many thanks!

1 ACCEPTED SOLUTION

sorry, somehow forgot to paste in the code for the calculated column:

Column =
VAR _action_A_max =
    CALCULATE (
        MAX ( 'Table'[Log_time] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Process] = "Action A" )
    )
RETURN
    IF (
        'Table'[Log_time] >= _action_A_max,
        CONCATENATE ( "Start of Process ", RIGHT ( 'Table'[Process], 1 ) ),
        BLANK ()
    )

View solution in original post

4 REPLIES 4
rlee1982
Helper III
Helper III

Thanks Sturla! It works!

sturlaws
Resident Rockstar
Resident Rockstar

Hi,

 

you create this calculated column

which returns this:

sturlaws_0-1654117639312.png

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Hi Sturla, would you mind sharing the pbix file? Thanks!

sorry, somehow forgot to paste in the code for the calculated column:

Column =
VAR _action_A_max =
    CALCULATE (
        MAX ( 'Table'[Log_time] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Process] = "Action A" )
    )
RETURN
    IF (
        'Table'[Log_time] >= _action_A_max,
        CONCATENATE ( "Start of Process ", RIGHT ( 'Table'[Process], 1 ) ),
        BLANK ()
    )

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors