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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Parkyerbike
New Member

Confused - iterating over values

Hello, I am after some help if possible.

 

I have a table, that contains a list of unique customer names. I have another table that contains details about that customer, this has a list of installations (not unique) and what I would really like to do, is create a column in customer name, that has the latest version of the software, based on date and subsys where the environment is set to production

 

So, as an example, I would like the customer table to end up something like this, with an entry for each customer, based on the latest date from another table, based on subsys = CR and environment = production

 

Customer Table - Key = ID

Parkyerbike_0-1715959689384.png

 

Patch Table - Key is IdentifiedInstallationID

Parkyerbike_1-1715959751953.png

 

So I am thinking I would need to iterate over the dates, per IdentifiedInstallationID where SubSys = CR and Environment = production and bring back the latest entry

 

Thanks in advance

 

1 ACCEPTED SOLUTION

Hi,

Enter this calculated column formula in Table1

Column = LOOKUPVALUE(Table2[Software Name],Table2[Date Patch Applied],CALCULATE(MAX(Table2[Date Patch Applied]),FILTER(Table2,Table2[ID]=EARLIER(Table1[ID])&&Table2[Environment]="Production"&&Table2[Subsys]="CR")),Table2[ID],Table1[ID])

Hope this helps.

Ashish_Mathur_0-1715989641547.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Parkyerbike
New Member

 

IDCustomer NameSoftware Version (Trying to generate this)
1ABC CoVersion 3
2Fred BloggsVersion 2
3A Company 
4B Company 
5C Company 

 

Trying to create the above column, based on sample data below

 

Where the Environment = Production, the Subsys is CR and the latest date in the list per ID

 

IDEnvironmentDate Patch AppliedSubsysSoftware Name
1Production1/2/24CRVersion 1
1Production3/2/24CRVersion 2
1Production5/2/24CRVersion 3
1Staging3/2/24CRVersion 4
2Production3/2/24ABVersion 4
2Production5/2/24CRVersion 2

 

Hope that helps

 

Thanks

Hi,

Enter this calculated column formula in Table1

Column = LOOKUPVALUE(Table2[Software Name],Table2[Date Patch Applied],CALCULATE(MAX(Table2[Date Patch Applied]),FILTER(Table2,Table2[ID]=EARLIER(Table1[ID])&&Table2[Environment]="Production"&&Table2[Subsys]="CR")),Table2[ID],Table1[ID])

Hope this helps.

Ashish_Mathur_0-1715989641547.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ritaf1983
Super User
Super User

Hi @Parkyerbike 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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