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
Vinothsusai
Helper III
Helper III

Calculate amount based on range mapping for each line item

Hi,

I have a two tables below and statutory table defined ranging in gross accounts column. For ex: 109*  can be 10910000, 10920000. It can be any range mapping in ledger table Main accounts column defined below. I want to calculate amount based on the range mappings for each line items.Could you please advise.

 

Statutory Table

DebitorGross AccountsAmount
Capital souscrit non appelé (I)109* 
ACTIF IMMOBILISÉ*  
IMMOBILISATIONS INCORPORELLES  
Frais d'établissement*201* 
Frais de recherche et de développement*203* 
Concession, brevets et droits similaire205* 
Fonds commercial (1)206*+207* 
Autres immobilisations incorporelles208* 
Avances et acomptes sur immobilisations incorporelles237* 

 

Ledger Table

MainAccountAmount
109100002000
109200001700
201000002300
2010000140000
2010000236777
2031000033232
203000011211
203000023232
20500000322
20510000434
205200008989
20600000786868
20600001898989
206000026767
2061100267767
20710000675676
2070000165656
2070000256456
2071100266767
2080000089898
2080000132323
208000023434
237000012332
2370000332323

 

50.png

 

Please advise.

 

Thanks

Vinoth SUSAINATHAN

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Vinothsusai ,

You can achieve in "Edit Query":

1. Add a custom column in "Statutory Table" , then Split the custom column by position:

aa1.PNGaa2.PNG

You will get a table like this:

aa3.PNG

 

2. Do the same for "Ledger Table ", But one more step: Replace the value 207 with 206 .

aa4.PNG

3. create relationship between the two tables:

aa5.PNG

aa7.PNG

 

Best regards,
Lionel Chen

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

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @Vinothsusai ,

You can achieve in "Edit Query":

1. Add a custom column in "Statutory Table" , then Split the custom column by position:

aa1.PNGaa2.PNG

You will get a table like this:

aa3.PNG

 

2. Do the same for "Ledger Table ", But one more step: Replace the value 207 with 206 .

aa4.PNG

3. create relationship between the two tables:

aa5.PNG

aa7.PNG

 

Best regards,
Lionel Chen

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

amitchandak
Super User
Super User

There are a few ways. If there not many values try this

 

From gross column create three-digit code, for 201* = 201 and for 206* 207* you can take only one.

 

On the other side, Main Account creates a three-digit code using the left function. Put a logic to convent 207 to 206 and for similar fields.

Now you can join.

Hope this can help.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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.