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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

If the raw data appears more than once, mark it differently

Hello All, I need a help with following: if the PackageCode appears more than one time in the row "Test Status" shall show first occurance as "Test" and the rest for the same PackageCode as "Retest" as shown. I have tried this code, but it turns everything to "Retest". I have simulated what I expect in Excel as an example below

 

nazrinka_0-1595238679928.png

nazrinka_1-1595238707120.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try like as new column

if(countx(filter(Table, table[package code] =earlier(table[package code] ) && table[StatechangeTS] <=earlier(table[StatechangeTS] )),table[package code] )=1, "Test","Retest")

View solution in original post

3 REPLIES 3
danielkrol
Helper II
Helper II

With EARLIER you are comparing earlier packagecodes, not by date.

 

Can you post your data as csv, or ad your pbix? It will make it easier to create sample code for you.


amitchandak
Super User
Super User

@Anonymous , try like as new column

if(countx(filter(Table, table[package code] =earlier(table[package code] ) && table[StatechangeTS] <=earlier(table[StatechangeTS] )),table[package code] )=1, "Test","Retest")

Anonymous
Not applicable

Thanks again for response, 

How can I put the filter in the script that it takes ONLY results for Static tester in the calculation? so when the same module appears in static and dynamic tester, one of them does not count as restest, cause it is being ignored. 

PS: without filtering out the "Destination" with column filter option in the table top

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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