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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Check previous values on same ID

Hey there!

 

I've got a question regarding the following:

In my dataset I have the following columns

 

Customer ID |  Product  |  Up-to-date | 

1                       TV                1
1                       Fridge          0
2                       TV                1
3                       Car               0

Up-to-date in this regard means if the information on the product, assigned to the customer, is complete (Filled in correctly)

In my example you can see that customer 1 has 2 products under its name. 1 being up-to-date, the other one isn't.

 

Question: Is it possible to create a new column where if Customer has 1 or more values of 0 in Column "up-to-date", return value 0 for all rows (on that specific customer) (See example below)

Customer ID |  Product  |  Up-to-date |  IndexUpToDate

1                       TV                1                       0
1                       Fridge          0                       0
2                       TV                1                       1
3                       Car               0                       0

I would love to hear from you. If you have any questions, please do ask.

 

Kind regards and thanks in advance,
Daniël

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Try a new column like

IndexUpToDate = if(countx(filter(table[Customer ID] = earlier([Customer ID]) && [Up-to-date]=0),[Up-to-date])+0>0,0,[Up-to-date])

 

or

 

IndexUpToDate = if(countx(filter(table[Customer ID] = earlier([Customer ID]) && [Up-to-date]=0),[Up-to-date])+0>0,0,1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for the swift reply!

When I try to use "if(countx(filter(table[Customer ID] = earlier([Customer ID]) && [Up-to-date]=0),[Up-to-date])+0>0,0,[Up-to-date])"

It doesn't let me select the first table[Customer ID], it wants a Table, not a column name.

 

Did I need to do anything beforehand, to make the column formula work?

 

@Anonymous - I believe that should be:

if(
  countx(
    filter(
      table,
      [Customer ID] = earlier([Customer ID]) && 
        [Up-to-date]=0
    ),
    [Up-to-date]
  )+0>0,
  0,
  [Up-to-date]
)

I think you missed a comma after table

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Anonymous 

you can try this

Column = 
VAR _count=CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[customerID]=EARLIER('Table'[customerID])&&'Table'[up-to-date]=0))
return if(_count>0,0,'Table'[up-to-date])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.