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
ErikBe
Frequent Visitor

chart of accounts alignment between two different systems

Hello masters of PowerBi,

 

 I am sitting with two different business systems and with them, two separate chart of accounts. One very detailed (the chart of account in the ERP system) and one more aggregated (the consolidation system's chart of accounts).

 

In PBi, I would like to be able to tie the ERP account transaction to the specific consolidation system account it is mapped to. The mapping structure is presented below as table 1 whereas table 2 is the the facttable I want to add an additional column that shows the consolidation account.

 

Fyi, in table 2 to I have actually already added the desired column just to give you an idea what I am after. 

 

I hope I've left enough info and that someone has the time to help me. Regardless, have a good weekend and stay safe.

 

Best regards,

Erik

 

 

Table 1 

 

From accountto accountconsolidation account
501000501000501000-000
502000502000502000-000
503000504000503000-000
506000506200506000-000
507000507000507000-000
509000509000509000-000
521000522000521000-000
541000541500541000-000
542000542000542000-000
544000544000544000-000
546000546500546000-000
545100545100546000-000
546600546600546600-000
546700548000548000-000
551000551000551000-000
559000559500559000-000
561500561500561500-000
561600561900561900-000
571000571100571000-000
572000572000572000-000
573000573000573000-000
579000579000579000-000
581000581200581000-000
582000582000582000-000
583000583000583000-000
584000584000584000-000
596100596100599000-000
599100599199599100-000
605100605100605000-000
605000605000605000-000
607000607200607000-000
609000609200609000-000

 

 

DateERP system accountAmountConsolidation Account
2020-01-0150100025501000-000
2020-01-02503500100503000-000
2020-01-035595005000559000-000
2020-01-045619002000561900-000
2020-01-0560910010000609000-000

Table 2

 

Ps. sorry for the ugly table examples. I seem to be quite bad at adding tables to my posts..

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

Hi @ErikBe ,

you can add a column to your table the creates one row for each potential account number: {[From account]..[to account]}

 

This is the full code that you can paste into the advanced editor:


let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZJBCsMwDAT/knMLtmvL0VtK//+NEvDUu6G3yTJBWuH3+xilllKOxx2e18fncQmN3ECEF3kHXi4EeTTAhYlgIEKSG2yhsXxjyeYtOkKvA3CBHx1EoJ2DCNTswQiv2Udd+Q9uQgS5ggpz5WcR2MKgpoMIHHDkAEwI7uOgQpCnwBYmo2etgI2YXNhBBF6Ugwi0cNjCyQ5nbYALjHYQgdEOIvAMHLaQsepv8CUzf3nNXCBClPVOFIoLRfJ/wiSfDXAhERJhL/n5Ag==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"From account" = _t, #"to account" = _t, #"consolidation account" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"From account", Int64.Type}, {"to account", Int64.Type}, {"consolidation account", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "AccountNo", each {[From account]..[to account]}),
    #"Expanded AccountNo" = Table.ExpandListColumn(#"Added Custom", "AccountNo")
in
    #"Expanded AccountNo"

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

3 REPLIES 3
ImkeF
Super User
Super User

Hi @ErikBe ,

you can add a column to your table the creates one row for each potential account number: {[From account]..[to account]}

 

This is the full code that you can paste into the advanced editor:


let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZJBCsMwDAT/knMLtmvL0VtK//+NEvDUu6G3yTJBWuH3+xilllKOxx2e18fncQmN3ECEF3kHXi4EeTTAhYlgIEKSG2yhsXxjyeYtOkKvA3CBHx1EoJ2DCNTswQiv2Udd+Q9uQgS5ggpz5WcR2MKgpoMIHHDkAEwI7uOgQpCnwBYmo2etgI2YXNhBBF6Ugwi0cNjCyQ5nbYALjHYQgdEOIvAMHLaQsepv8CUzf3nNXCBClPVOFIoLRfJ/wiSfDXAhERJhL/n5Ag==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"From account" = _t, #"to account" = _t, #"consolidation account" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"From account", Int64.Type}, {"to account", Int64.Type}, {"consolidation account", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "AccountNo", each {[From account]..[to account]}),
    #"Expanded AccountNo" = Table.ExpandListColumn(#"Added Custom", "AccountNo")
in
    #"Expanded AccountNo"

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

lbendlin
Super User
Super User

Can you please try to explain it again? where did the date come from? where did the from/to accounts go?

Hi Ibendlin,

 

Thank you for the reply. The dates are tied to the transactions and come from the transaction table the second table in the original post. The from/to accounts comes from the static mapping table (the first table in the original post).

 

best regards,

Erik

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