Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Roy_W
Frequent Visitor

Need help with DAX formula for updating the column based on another column changes

I have a table called "Original" as follows. I need to add a new column, temporarily named "nw_updated_date" (referencing "Updated"). The logic is to update the "nw_updated_date" only when the "reason" changes. For example, in the case of id = 1, when rev changes from 3 to 7 and the "reason" is "assigned" for all these rows, then "nw_updated_date" should be "07:02:06AM".

 

Original:
id,rev,reason,updated_date
1,1,awaiting,11/13/2023 10:02:06AM
1,2,awaiting,11/13/2023 11:02:06AM
1,3,assigned,11/14/2023 07:02:06AM
1,4,assigned,11/14/2023 09:02:06PM
1,5,assigned,11/15/2023 09:02:06PM
1,6,assigned,11/16/2023 09:02:06PM
1,7,assigned,11/17/2023 09:02:06PM
1,8,awaiting,11/18/2023 07:02:06PM
2,1,awaiting,11/13/2023 07:02:06PM
2,2,awaiting,11/15/2023 10:02:06PM

Updated:
id,rev,reason,updated_date,nw_updated_date
1,1,awaiting,11/13/2023 10:02:06AM,11/13/2023 10:02:06AM
1,2,awaiting,11/13/2023 11:02:06AM,11/13/2023 10:02:06AM
1,3,assigned,11/14/2023 07:02:06AM,11/14/2023 07:02:06AM
1,4,assigned,11/14/2023 09:02:06PM,11/14/2023 07:02:06AM
1,5,assigned,11/15/2023 09:02:06PM,11/14/2023 07:02:06AM
1,6,assigned,11/16/2023 09:02:06PM,11/14/2023 07:02:06AM
1,7,assigned,11/17/2023 09:02:06PM,11/14/2023 07:02:06AM
1,8,awaiting,11/18/2023 07:02:06PM,11/18/2023 07:02:06PM
2,1,awaiting,11/13/2023 07:02:06PM,11/13/2023 07:02:06PM
2,2,awaiting,11/15/2023 10:02:06PM,11/13/2023 07:02:06PM

 

Can you please help me with the DAX formula for this?

I also attached sample PBI file, please check.

Roy_W_0-1700186639056.png

 

PBI_file 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Roy_W ,

Below is my table:

vxiandatmsft_0-1700446902294.png

The following DAX might work for you:

new update date = 
     IF(
        'Table'[Id] == 1 && 'Table'[reason] = "assigned" ,
        CALCULATE(
        MIN('Table'[updated_date]),
        FILTER('Table','Table'[Id] == 1 && 'Table'[reason] = "assigned")),
        'Table'[updated_date]
    )

The final output is shown in the following figure:

vxiandatmsft_1-1700446948665.png

Best Regards,

Xianda Tang

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Roy_W ,

Below is my table:

vxiandatmsft_0-1700446902294.png

The following DAX might work for you:

new update date = 
     IF(
        'Table'[Id] == 1 && 'Table'[reason] = "assigned" ,
        CALCULATE(
        MIN('Table'[updated_date]),
        FILTER('Table','Table'[Id] == 1 && 'Table'[reason] = "assigned")),
        'Table'[updated_date]
    )

The final output is shown in the following figure:

vxiandatmsft_1-1700446948665.png

Best Regards,

Xianda Tang

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

Rupak_bi
Super User
Super User

try this

new update date =
calculate(min(Query1[updated_date]),allexcept(Query1,Query1[id],Query1[reason]))


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.