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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
learner03
Post Partisan
Post Partisan

MAX date based on another column

I have a column with values A & B and a date column which show when the data was updated for A & B.
I need to make a new calculated column, which shows when A was last updated and when B was last updated.

I am using below but it says circlar dependecy-

"

VAR CurrentValue =table1[A&B]
RETURN
    IF(
        CurrentValue = "A",
        CALCULATE(MAXX(FILTER('table1', table1[A&B] = "A" && NOT(ISBLANK('table1[Date update]))), 'table1[Date update])),
        IF(
            CurrentValue = "IFC",
            CALCULATE(MAXX(FILTER('table 1','table1[A&B]= "B" && NOT(ISBLANK(table1[Date update]))), 'table1[Date update])),
            BLANK()
        )
    )

"

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @learner03 ,

It could be a DAX measure that is causing the circular dependency.
I tried to create data to reproduce your problem, here are my test steps:
Test data

vheqmsft_0-1710380395542.png

Apply your calculate column

vheqmsft_1-1710380483432.png

Here's my modification of this dax to achieve your goal

LastUpdateDate = 
CALCULATE(
    MAX('Table'[Date update]),
    FILTER(
        'Table',
        'Table'[A&B] = EARLIER('Table'[A&B])
        && NOT(ISBLANK('Table'[Date update]))
    )
)

Final output

vheqmsft_2-1710380576026.png

vheqmsft_3-1710380598163.png

You can refer to this link for more information on cyclic dependencies
Avoiding circular dependency errors in DAX - SQLBI

 

Best regards,

Albert He

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @learner03 ,

It could be a DAX measure that is causing the circular dependency.
I tried to create data to reproduce your problem, here are my test steps:
Test data

vheqmsft_0-1710380395542.png

Apply your calculate column

vheqmsft_1-1710380483432.png

Here's my modification of this dax to achieve your goal

LastUpdateDate = 
CALCULATE(
    MAX('Table'[Date update]),
    FILTER(
        'Table',
        'Table'[A&B] = EARLIER('Table'[A&B])
        && NOT(ISBLANK('Table'[Date update]))
    )
)

Final output

vheqmsft_2-1710380576026.png

vheqmsft_3-1710380598163.png

You can refer to this link for more information on cyclic dependencies
Avoiding circular dependency errors in DAX - SQLBI

 

Best regards,

Albert He

 

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors