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

Row base looping to merge table base on variable keys (Nested loop)

Hi,

I have a script in pyhton that does the job but I was ask to re-write the code in M.

 

The problem is the folowing.

I have 1 table with transactional record (Transaction_table)

Second table containing rules that need to be validated in order (rule_table)

So if the transaction key match the mapping rule a row one insert the mapping results for row one, else move to the second rule until you find a match is no match found, well no match is the value to insert in the transaction.

Note: that the match need to be done row by row since it's priority based


the only thing is that the key for the merge is variable base on the rule (mapping table)

B_B_0-1654522126349.png

 


 In python it's 2 loop imbeded once you find the result you break the loop and return the results but in M i am not sure if this is possible or I am not really sure how to implement the solution.

 

thks for your help

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

Why row no. 22 not in rule is there and Y/Z pushed at the bottom?

Anonymous
Not applicable

It was an example that I was westing where their was a new transaction that was not in the mapping file (Rules) so I would attribute the the label XX to be able to adjust the values in the rule with the user.

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.

Top Solution Authors
Top Kudoed Authors