From 16f600df4518dd59d5ce12ba3c1fb3dfc662590e Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 14:23:43 +1000 Subject: [PATCH 01/10] Added company encoding table to model and updated base link reference to use the encoded company name instead of company parameter --- .../definition/model.tmdl | 3 +- .../definition/tables/Company Encoding.tmdl | 35 +++++++++++++++++++ .../definition/tables/Documents.tmdl | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/model.tmdl index 7393882c7b..a4b4a84c8e 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/model.tmdl @@ -33,7 +33,7 @@ queryGroup 'Document and Line Type Enums' annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["Sales Lines","Sales Value Entries","Sales Budget","Item","Location","Customer","Salesperson","Sales Budget Name","Dimension Sets","ENVIRONMENT","COMPANY","API_ENDPOINT","ConvertUTC","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","InvertSignsSalesLines","InvertSignsResourceLedgerEntries","InvertSignsGeneralLedgerEntries","Standard Calendar Time Intelligence","Fiscal Calendar Time Intelligence","Weekly Calendar Time Intelligence","Date Table Setup","Working Days","Opportunity Entries","Contacts","Reason Codes","Item Category","Opportunities","Sales Cycle Stages","Close Opportunity Codes","Resources","G/L Accounts","Documents","Sales Invoice Lines","Sales Credit Lines","Type","Sales Invoice Project Ledger Entries","Sales Credit Project Ledger Entries","Project Ledger Entries","Project","Sales Line Type","Sales Document Type","Project Journal Line Type","Item Ledger Document Type"] +annotation PBI_QueryOrder = ["Sales Lines","Sales Value Entries","Sales Budget","Item","Location","Customer","Salesperson","Sales Budget Name","Dimension Sets","ENVIRONMENT","COMPANY","API_ENDPOINT","ConvertUTC","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","InvertSignsSalesLines","InvertSignsResourceLedgerEntries","InvertSignsGeneralLedgerEntries","Standard Calendar Time Intelligence","Fiscal Calendar Time Intelligence","Weekly Calendar Time Intelligence","Date Table Setup","Working Days","Opportunity Entries","Contacts","Reason Codes","Item Category","Opportunities","Sales Cycle Stages","Close Opportunity Codes","Resources","G/L Accounts","Documents","Sales Invoice Lines","Sales Credit Lines","Type","Sales Invoice Project Ledger Entries","Sales Credit Project Ledger Entries","Project Ledger Entries","Project","Sales Line Type","Sales Document Type","Project Journal Line Type","Item Ledger Document Type","Company Encoding"] annotation __TEdtr = 1 @@ -82,6 +82,7 @@ ref table 'Sales Document Type' ref table 'Project Journal Line Type' ref table 'Item Ledger Document Type' ref table 'Lost Customer Month Range' +ref table 'Company Encoding' ref cultureInfo en-US ref cultureInfo es-ES diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..41c2c89c73 --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,35 @@ +table 'Company Encoding' + lineageTag: 179fe678-f573-465e-a78e-bd4ced81294c + + column ParameterValue + dataType: string + lineageTag: 6826bae4-1d98-4037-a748-0f4ebacf63ed + summarizeBy: none + sourceColumn: ParameterValue + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + lineageTag: fbbe6b29-c8a7-4614-9247-de7cbffe05e0 + summarizeBy: none + sourceColumn: Encoded Company Name + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Documents.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Documents.tmdl index 1f6382476d..52075b48bd 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Documents.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Documents.tmdl @@ -14,7 +14,7 @@ table Documents VAR BusinessCentral = "https://businesscentral.dynamics.com/" VAR TenantID = VALUES('Date Table Setup'[tenantID]) VAR Environment = VALUES(ENVIRONMENT[ENVIRONMENT]) - VAR Company = "?company=" & VALUES(COMPANY[COMPANY]) + VAR Company = "?company=" & VALUES('Company Encoding'[Encoded Company Name]) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company displayFolder: _Sales Measures\_Back Links lineageTag: db385722-aa98-416b-bd98-d5058fe788c9 From e66a87f76b95a6dcea9c6e5e19ca5d3e09fea220 Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 14:33:36 +1000 Subject: [PATCH 02/10] Added company encoding table to Finance App --- .../definition/model.tmdl | 3 +- .../definition/tables/Company Encoding.tmdl | 35 +++++++++++++++++++ .../definition/tables/G%2FL Entries.tmdl | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/model.tmdl index e35ee694cc..f2ff63dc57 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/model.tmdl @@ -38,7 +38,7 @@ queryGroup 'Parameters and Functions\Connection Parameters' annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["Balance Sheet G/L Entries","Income Statement G/L Entries","Close Income Statement G/L Entries","G/L Entries","G/L Budget Entries","ENVIRONMENT","COMPANY","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","GetParentGLAccountNo","Balance Sheet Measures","GLAccountPosting","GLAccountEndTotal","G/L Account","G/L Account Category","Dimension Sets","G/L Budget","Income Statement Measures","Activity KPIs","Liquidity KPIs","Profitability KPIs","Date Table Setup","Working Days","Standard Calendar Time Intelligence","Fiscal Calendar Time Intelligence","Weekly Calendar Time Intelligence","Customer Ledger Entries","Vendor Ledger Entries","Vendors","Customers","Power BI Account Categories","API_ENDPOINT","CheckUpgradeQuery","Close Income Statement Codes","ConvertUTC","Build Closing Entry Filter","Closing Entry Filter Table","Back Links"] +annotation PBI_QueryOrder = ["Balance Sheet G/L Entries","Income Statement G/L Entries","Close Income Statement G/L Entries","G/L Entries","G/L Budget Entries","ENVIRONMENT","COMPANY","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","GetParentGLAccountNo","Balance Sheet Measures","GLAccountPosting","GLAccountEndTotal","G/L Account","G/L Account Category","Dimension Sets","G/L Budget","Income Statement Measures","Activity KPIs","Liquidity KPIs","Profitability KPIs","Date Table Setup","Working Days","Standard Calendar Time Intelligence","Fiscal Calendar Time Intelligence","Weekly Calendar Time Intelligence","Customer Ledger Entries","Vendor Ledger Entries","Vendors","Customers","Power BI Account Categories","API_ENDPOINT","CheckUpgradeQuery","Close Income Statement Codes","ConvertUTC","Build Closing Entry Filter","Closing Entry Filter Table","Back Links","Company Encoding"] annotation __BNorm = 1 @@ -82,6 +82,7 @@ ref table 'Closing Entry Filter Table' ref table ENVIRONMENT ref table 'Back Links' ref table 'Translated Localized Labels' +ref table 'Company Encoding' ref cultureInfo en-US ref cultureInfo es-ES diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..3b035d8a7d --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,35 @@ +table 'Company Encoding' + lineageTag: 9e6a9d70-a0a6-4618-87e3-fd62f05afb38 + + column ParameterValue + dataType: string + lineageTag: fae850ad-94d1-42ad-8e46-5759ca39e7ed + summarizeBy: none + sourceColumn: ParameterValue + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + lineageTag: 6f662f9a-0754-40be-b980-04f652e3d84b + summarizeBy: none + sourceColumn: Encoded Company Name + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Entries.tmdl index e73cccd586..2439e286d8 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/G%2FL Entries.tmdl @@ -155,7 +155,7 @@ table 'G/L Entries' VAR BusinessCentral = "https://businesscentral.dynamics.com/" VAR TenantID = VALUES('Date Table Setup'[tenantID]) VAR Environment = VALUES(ENVIRONMENT[ENVIRONMENT]) - VAR Company = "?company=" & VALUES(COMPANY[COMPANY]) + VAR Company = "?company=" & VALUES('Company Encoding'[Encoded Company Name]) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company displayFolder: _G/L Entry Measures\_G/L Entry Back Links lineageTag: b08bfde7-4752-45b9-b9ce-53d9c0ce7665 From 50ac5e0e70e20a1972cd6fcb46c852c34d0fe250 Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 15:23:09 +1000 Subject: [PATCH 03/10] Added company encoding to Inventory App --- .../definition/model.tmdl | 3 +- .../definition/tables/Company Encoding.tmdl | 44 +++++++++++++++++++ .../tables/Item Ledger Entries.tmdl | 3 +- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/model.tmdl index 88ab1e7584..6d9fde5738 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/model.tmdl @@ -29,7 +29,7 @@ queryGroup 'Parameters and Functions\Functions' annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["Item Ledger Entries","Warehouse Entries","Item","Location","Customer","Vendor","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","Working Days","Date Table Setup","Purchase Lines","Zone","Bin","Dimension Sets","Sales Lines","Assembly Lines","Assembly Headers","Project Planning Lines","Warehouse Journal Lines (To Bin)","Warehouse Journal Lines (From Bin)","Warehouse Activity Lines","Production Order Lines","Prod Order Component Lines","Service Lines","Transfer Lines","Requisition Line","Planning Component Lines","Lot No","Serial No","ENVIRONMENT","COMPANY","API_ENDPOINT","ConvertUTC","Item Category","ABC Classes"] +annotation PBI_QueryOrder = ["Item Ledger Entries","Warehouse Entries","Item","Location","Customer","Vendor","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","Working Days","Date Table Setup","Purchase Lines","Zone","Bin","Dimension Sets","Sales Lines","Assembly Lines","Assembly Headers","Project Planning Lines","Warehouse Journal Lines (To Bin)","Warehouse Journal Lines (From Bin)","Warehouse Activity Lines","Production Order Lines","Prod Order Component Lines","Service Lines","Transfer Lines","Requisition Line","Planning Component Lines","Lot No","Serial No","ENVIRONMENT","COMPANY","API_ENDPOINT","ConvertUTC","Item Category","ABC Classes","Company Encoding"] annotation __TEdtr = 1 @@ -74,6 +74,7 @@ ref table 'Item Category' ref table 'ABC Classes' ref table 'ABC Classification' ref table 'Translated Localized Labels' +ref table 'Company Encoding' ref perspective 'Fiscal Calendar' ref perspective 'Standard Calendar' diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..0963963ace --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,44 @@ +table 'Company Encoding' + isHidden + lineageTag: 9104d373-1d32-4da1-8038-0c54219dde4d + + column ParameterValue + dataType: string + isHidden + lineageTag: d39a75fd-04cb-49c7-849e-29f3e129ee76 + summarizeBy: none + sourceColumn: ParameterValue + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + isHidden + lineageTag: d8f09e29-5dbd-45b0-9345-0a2fcadae11e + summarizeBy: none + sourceColumn: Encoded Company Name + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + changedProperty = IsHidden + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Item Ledger Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Item Ledger Entries.tmdl index 3192c9020d..722cb055e8 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Item Ledger Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory app/Inventory app.SemanticModel/definition/tables/Item Ledger Entries.tmdl @@ -68,10 +68,9 @@ table 'Item Ledger Entries' measure 'Base Link' = VAR BusinessCentral = "https://businesscentral.dynamics.com/" - //VAR TenantID = VALUES('TENANT ID'[TENANT ID]) VAR TenantID = VALUES('Date Table Setup'[tenantID]) VAR Environment = VALUES(ENVIRONMENT[ENVIRONMENT]) - VAR Company = "?company=" & VALUES(COMPANY[COMPANY]) + VAR Company = "?company=" & VALUES('Company Encoding'[Encoded Company Name]) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company displayFolder: _Back Links lineageTag: 5ce10cd7-9520-4a7c-a650-b492a4dd903b From 1314c386a209cec7180c6e1a0c5904368e10db82 Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 15:31:04 +1000 Subject: [PATCH 04/10] Added Company Encoding to Inventory Valuation App --- .../definition/model.tmdl | 3 +- .../definition/tables/Company Encoding.tmdl | 44 +++++++++++++++++++ .../definition/tables/Value Entries.tmdl | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/model.tmdl index 54138b5ce0..288284aa07 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/model.tmdl @@ -29,7 +29,7 @@ queryGroup 'Parameters and Functions\Functions' annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["Item","Location","ENVIRONMENT","COMPANY","Value Entries","Working Days","Date Table Setup","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","Dimension Sets","API_ENDPOINT","ConvertUTC","Item Category"] +annotation PBI_QueryOrder = ["Item","Location","ENVIRONMENT","COMPANY","Value Entries","Working Days","Date Table Setup","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","Dimension Sets","API_ENDPOINT","ConvertUTC","Item Category","Company Encoding"] annotation __TEdtr = 1 @@ -50,6 +50,7 @@ ref table COMPANY ref table ENVIRONMENT ref table 'Item Category' ref table 'Translated Localized Labels' +ref table 'Company Encoding' ref cultureInfo en-US ref cultureInfo cs-CZ diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..6bef52dba4 --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,44 @@ +table 'Company Encoding' + isHidden + lineageTag: a0a0d2e5-59f8-4da0-b914-15a4a1ec7617 + + column ParameterValue + dataType: string + isHidden + lineageTag: 220fa446-0d20-4ffb-88ec-96bc688e6cb6 + summarizeBy: none + sourceColumn: ParameterValue + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + isHidden + lineageTag: 7d57cb18-28e5-4e60-9f4c-2dc6f293fda0 + summarizeBy: none + sourceColumn: Encoded Company Name + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + changedProperty = IsHidden + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Value Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Value Entries.tmdl index 86af63193b..69888d97c1 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Value Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Inventory Valuation app/Inventory Valuation app.SemanticModel/definition/tables/Value Entries.tmdl @@ -358,7 +358,7 @@ table 'Value Entries' VAR BusinessCentral = "https://businesscentral.dynamics.com/" VAR TenantID = VALUES('Date Table Setup'[tenantID]) VAR Environment = VALUES(ENVIRONMENT[ENVIRONMENT]) - VAR Company = "?company=" & VALUES(COMPANY[COMPANY]) + VAR Company = "?company=" & VALUES('Company Encoding'[Encoded Company Name]) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company isHidden displayFolder: _Inventory Value Entry Measures\Back Links From 88aab0c1fda94521070dad4d7280c7f1cf2f69d4 Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 15:49:12 +1000 Subject: [PATCH 05/10] Add company encoding to Manufacturing App --- .../definition/model.tmdl | 3 +- .../definition/tables/Back Links.tmdl | 2 +- .../definition/tables/Company Encoding.tmdl | 44 +++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/model.tmdl index 92399e8aa2..d65e5f8537 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/model.tmdl @@ -29,7 +29,7 @@ queryGroup 'Date Table' annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["Item","Dimension Sets","ENVIRONMENT","COMPANY","API_ENDPOINT","Production Order Lines","Prod Order Components","Prod Order Routing Lines","Prod Order Capacity Need","Item Ledger Entries","Capacity Ledger Entries","Calendar Entries","Work Center","Date Table Setup","Working Days","Machine Center","Location","Routing Link","Routing","Production Orders","Production Orders (Released or Finished)","Work Center Group","Value Entries","Manufacturing Setup","DimensionSets_DataSource","DimensionSet_Blank","Dimensions","Inventory Adjustment Entry Order Line","Back Links","Time Factors","Item Category","ConvertUTC","ConvertManufacturingStartEndTimes"] +annotation PBI_QueryOrder = ["Item","Dimension Sets","ENVIRONMENT","COMPANY","API_ENDPOINT","Production Order Lines","Prod Order Components","Prod Order Routing Lines","Prod Order Capacity Need","Item Ledger Entries","Capacity Ledger Entries","Calendar Entries","Work Center","Date Table Setup","Working Days","Machine Center","Location","Routing Link","Routing","Production Orders","Production Orders (Released or Finished)","Work Center Group","Value Entries","Manufacturing Setup","DimensionSets_DataSource","DimensionSet_Blank","Dimensions","Inventory Adjustment Entry Order Line","Back Links","Time Factors","Item Category","ConvertUTC","ConvertManufacturingStartEndTimes","Company Encoding"] annotation __TEdtr = 1 @@ -67,6 +67,7 @@ ref table 'Back Links' ref table 'Time Factors' ref table 'Item Category' ref table 'Translated Localized Labels' +ref table 'Company Encoding' ref cultureInfo en-US ref cultureInfo cs-CZ diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Back Links.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Back Links.tmdl index 1dab82603d..48c0d33952 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Back Links.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Back Links.tmdl @@ -7,7 +7,7 @@ table 'Back Links' VAR BusinessCentral = "https://businesscentral.dynamics.com/" VAR TenantID = VALUES('Date Table Setup'[tenantID]) VAR Environment = VALUES(ENVIRONMENT[ENVIRONMENT]) - VAR Company = "?company=" & VALUES(COMPANY[COMPANY]) + VAR Company = "?company=" & VALUES('Company Encoding'[Encoded Company Name]) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company isHidden lineageTag: d4610d12-08d0-4e03-93f0-369ded9c2630 diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..35620e1cbb --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Manufacturing app/Manufacturing app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,44 @@ +table 'Company Encoding' + isHidden + lineageTag: 595fb95c-0edb-4fa6-9999-90c4cc77fb92 + + column ParameterValue + dataType: string + isHidden + lineageTag: 0b87d89b-497d-4684-90c3-bce538e6c6b7 + summarizeBy: none + sourceColumn: ParameterValue + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + isHidden + lineageTag: 1e269faf-2b83-41db-b3fa-65bb44931871 + summarizeBy: none + sourceColumn: Encoded Company Name + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + changedProperty = IsHidden + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + From c4597448de70abc812f291d7b67ffd0d50ea24f6 Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 16:30:41 +1000 Subject: [PATCH 06/10] Added company encoding to Project App --- .../definition/model.tmdl | 3 +- .../definition/tables/Company Encoding.tmdl | 35 +++++++++++++++++++ .../definition/tables/Project.tmdl | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/model.tmdl index a82b0b2c48..e5bebcc4f3 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/model.tmdl @@ -30,7 +30,7 @@ queryGroup 'Date Table' annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["Project Planning Line","Project Ledger Entry","Project","Customer","Tasks","Dimension Sets","Purchases","ENVIRONMENT","COMPANY","Dimensions","DimensionSets_DataSource","DimensionSet_Blank","Purchase Lines Outstanding","Purchase Lines Received Not Invoiced","API_ENDPOINT","Date Table Setup","Working Days","ConvertUTC","Items","G/L Accounts","Resources","Type"] +annotation PBI_QueryOrder = ["Project Planning Line","Project Ledger Entry","Project","Customer","Tasks","Dimension Sets","Purchases","ENVIRONMENT","COMPANY","Dimensions","DimensionSets_DataSource","DimensionSet_Blank","Company Encoding","Purchase Lines Outstanding","Purchase Lines Received Not Invoiced","API_ENDPOINT","Date Table Setup","Working Days","ConvertUTC","Items","G/L Accounts","Resources","Type"] annotation __TEdtr = 1 @@ -57,6 +57,7 @@ ref table Items ref table 'G/L Accounts' ref table Resources ref table Type +ref table 'Company Encoding' ref cultureInfo en-US ref cultureInfo cs-CZ diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..18df7be69e --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,35 @@ +table 'Company Encoding' + lineageTag: dfa38049-b6a7-4985-b754-44ee9f836e32 + + column ParameterValue + dataType: string + lineageTag: f37fc280-0a49-4975-9389-64f75aa2804f + summarizeBy: none + sourceColumn: ParameterValue + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + lineageTag: d7542b24-c883-42e0-a7d8-7eef5455f11a + summarizeBy: none + sourceColumn: Encoded Company Name + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Project.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Project.tmdl index c38b95cfed..e5548a7574 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Project.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Project.tmdl @@ -119,7 +119,7 @@ table Project VAR BusinessCentral = "https://businesscentral.dynamics.com/" VAR TenantID = VALUES('Date Table Setup'[tenantID]) VAR Environment = VALUES(ENVIRONMENT[ENVIRONMENT]) - VAR Company = "?company=" & VALUES(COMPANY[COMPANY]) + VAR Company = "?company=" & VALUES('Company Encoding'[Encoded Company Name]) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company isHidden displayFolder: _Project Measures\Back Links From 5264d4b1dfa762e4ce3e0b013a49394b289da196 Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 16:52:06 +1000 Subject: [PATCH 07/10] Added company encoding Purchasing App --- .../definition/model.tmdl | 3 +- .../definition/tables/Company Encoding.tmdl | 44 +++++++++++++++++++ .../definition/tables/Documents.tmdl | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/model.tmdl index fcc437ce05..0e51ac224d 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/model.tmdl @@ -32,7 +32,7 @@ queryGroup 'Purchase Types' annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["Item","Location","Vendor","Purchaser","Dimension Sets","InvertSignsPurchaseLines","InvertSignsResourceLedgerEntries","InvertSignsGeneralLedgerEntries","ENVIRONMENT","COMPANY","API_ENDPOINT","ConvertUTC","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","Documents","Purchase Budget","Date Table Setup","Working Days","Standard Calendar Time Intelligence","Fiscal Calendar Time Intelligence","Weekly Calendar Time Intelligence","Purchase Budget Name","Item Category","Purchase Lines","Purchase Value Entries","Resources","G/L Accounts","Purchase Invoice Lines","Purchase Credit Lines","Type","Project","Capacity Ledger Entries","Reason Codes","Item Ledger Document Type","Purchase Document Type","Purchase Line Type"] +annotation PBI_QueryOrder = ["Item","Location","Vendor","Purchaser","Dimension Sets","InvertSignsPurchaseLines","InvertSignsResourceLedgerEntries","InvertSignsGeneralLedgerEntries","ENVIRONMENT","COMPANY","API_ENDPOINT","ConvertUTC","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","Documents","Purchase Budget","Date Table Setup","Working Days","Standard Calendar Time Intelligence","Fiscal Calendar Time Intelligence","Weekly Calendar Time Intelligence","Purchase Budget Name","Item Category","Purchase Lines","Purchase Value Entries","Resources","G/L Accounts","Purchase Invoice Lines","Purchase Credit Lines","Type","Project","Capacity Ledger Entries","Reason Codes","Item Ledger Document Type","Purchase Document Type","Purchase Line Type","Company Encoding"] annotation __TEdtr = 1 @@ -73,6 +73,7 @@ ref table 'Reason Codes' ref table 'Item Ledger Document Type' ref table 'Purchase Document Type' ref table 'Purchase Line Type' +ref table 'Company Encoding' ref cultureInfo en-US ref cultureInfo da-DK diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..e7cd874c86 --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,44 @@ +table 'Company Encoding' + isHidden + lineageTag: 2aa38e5d-adf9-43af-8e26-395c32968ab4 + + column ParameterValue + dataType: string + isHidden + lineageTag: 42877ecb-90b3-4b4a-b771-a3a5eb43f486 + summarizeBy: none + sourceColumn: ParameterValue + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + isHidden + lineageTag: df24d753-3834-4602-9f9d-f2dc629888ae + summarizeBy: none + sourceColumn: Encoded Company Name + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + changedProperty = IsHidden + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Documents.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Documents.tmdl index 4f064f01ce..6fe18240a7 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Documents.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Purchase app/Purchase app.SemanticModel/definition/tables/Documents.tmdl @@ -74,7 +74,7 @@ table Documents VAR BusinessCentral = "https://businesscentral.dynamics.com/" VAR TenantID = VALUES('Date Table Setup'[tenantID]) VAR Environment = VALUES(ENVIRONMENT[ENVIRONMENT]) - VAR Company = "?company=" & VALUES(COMPANY[COMPANY]) + VAR Company = "?company=" & VALUES('Company Encoding'[Encoded Company Name]) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company displayFolder: _Purchase Measures\_Back Links lineageTag: bbc266f9-2fa9-45e4-adf0-278036f716f0 From 22184d6f6a1ca5bad958594caa121123c4c02440 Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 17:01:53 +1000 Subject: [PATCH 08/10] Added company encoding to Subscription Billing App --- .../definition/model.tmdl | 3 +- .../definition/tables/Company Encoding.tmdl | 44 +++++++++++++++++++ .../tables/Subscription Billing KPIs.tmdl | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/model.tmdl index 0036b1be1f..8883728e21 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/model.tmdl @@ -41,7 +41,7 @@ queryGroup Diemensions annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["ENVIRONMENT","COMPANY","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","Subscription","Dimension Sets","Date Table Setup","Working Days","Vendors","Customers","API_ENDPOINT","Default Contract Term","API_ENDPOINT_SUBSCR_BILLING","MaxForecastDate","MinReportingDate","fncPeriodsBetween","fctImproveColumnNames","SourceContractAnalysisEntries","ContractLineBase","Customer Contract Line","Vendor Contract Line","Vendor Contract Deferrals","Customer Contract Deferrals","Customer Contract","Vendor Contract","UBB handling","Is Released","Item","Salesperson","Meta Information","BCConnectionSubscriptionBilling","ConvertUTC","Item Category"] +annotation PBI_QueryOrder = ["ENVIRONMENT","COMPANY","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","Subscription","Dimension Sets","Date Table Setup","Working Days","Vendors","Customers","API_ENDPOINT","Default Contract Term","API_ENDPOINT_SUBSCR_BILLING","MaxForecastDate","MinReportingDate","fncPeriodsBetween","fctImproveColumnNames","SourceContractAnalysisEntries","ContractLineBase","Customer Contract Line","Vendor Contract Line","Vendor Contract Deferrals","Customer Contract Deferrals","Customer Contract","Vendor Contract","UBB handling","Is Released","Item","Salesperson","Meta Information","BCConnectionSubscriptionBilling","ConvertUTC","Item Category","Company Encoding"] annotation __BNorm = 1 @@ -83,6 +83,7 @@ ref table ENVIRONMENT ref table COMPANY ref table 'Item Category' ref table 'Translated Localized Labels' +ref table 'Company Encoding' ref cultureInfo en-US ref cultureInfo es-ES diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..c05e33c16e --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,44 @@ +table 'Company Encoding' + isHidden + lineageTag: 4a876159-6d69-48c3-bdaa-7c9cac199fd7 + + column ParameterValue + dataType: string + isHidden + lineageTag: 124452dd-0eec-4f67-a52c-785fda9fb6a2 + summarizeBy: none + sourceColumn: ParameterValue + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + isHidden + lineageTag: 45c84242-24fd-457d-8547-03cde9022d99 + summarizeBy: none + sourceColumn: Encoded Company Name + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + changedProperty = IsHidden + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/tables/Subscription Billing KPIs.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/tables/Subscription Billing KPIs.tmdl index 7d1532dc58..ac1de0650d 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/tables/Subscription Billing KPIs.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Subscription Billing app/Subscription Billing app.SemanticModel/definition/tables/Subscription Billing KPIs.tmdl @@ -674,7 +674,7 @@ table 'Subscription Billing KPIs' VAR BusinessCentral = "https://businesscentral.dynamics.com/" VAR TenantID = VALUES('Date Table Setup'[tenantID]) VAR Environment = VALUES(ENVIRONMENT[ENVIRONMENT]) - VAR Company = "?company=" & VALUES(COMPANY[COMPANY]) + VAR Company = "?company=" & VALUES('Company Encoding'[Encoded Company Name]) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company isHidden displayFolder: Back Links From efd49d35fd29a29d1c3d608ea1e9876bfa9d1d43 Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 17:04:57 +1000 Subject: [PATCH 09/10] Added company encoding to Sustainability App --- .../definition/model.tmdl | 3 +- .../definition/tables/Company Encoding.tmdl | 44 +++++++++++++++++++ .../tables/Sustainability Ledger Entries.tmdl | 4 +- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/tables/Company Encoding.tmdl diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/model.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/model.tmdl index bf1d823599..23c95c1ae0 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/model.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/model.tmdl @@ -38,7 +38,7 @@ queryGroup 'Parameters and Functions\Connection Parameters' annotation __PBI_TimeIntelligenceEnabled = 0 -annotation PBI_QueryOrder = ["ENVIRONMENT","COMPANY","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","Sustainability Accounts","Sustainability Account Category","Date Table Setup","Working Days","API_ENDPOINT","Sustainability Ledger Entries","Country/Region","Responsibility Centre","Dimension Sets","Sustainability Goals","Employee Ledger Entries","Employees","Employee Qualifications","Emission Fees","Employee Absences","Sustainability Sub-Account Categories","ConvertUTC"] +annotation PBI_QueryOrder = ["ENVIRONMENT","COMPANY","Dimensions","DimensionSet_Blank","DimensionSets_DataSource","GetDimCode","GetDimCodeCaption","GetDimNameCaption","Sustainability Accounts","Sustainability Account Category","Date Table Setup","Working Days","API_ENDPOINT","Sustainability Ledger Entries","Country/Region","Responsibility Centre","Dimension Sets","Sustainability Goals","Employee Ledger Entries","Employees","Employee Qualifications","Emission Fees","Employee Absences","Sustainability Sub-Account Categories","ConvertUTC","Company Encoding"] annotation __BNorm = 1 @@ -69,6 +69,7 @@ ref table 'Sustainability Sub-Account Categories' ref table Employees ref table ENVIRONMENT ref table 'Translated Localized Labels' +ref table 'Company Encoding' ref cultureInfo en-US ref cultureInfo es-ES diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/tables/Company Encoding.tmdl new file mode 100644 index 0000000000..7604f9cd15 --- /dev/null +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -0,0 +1,44 @@ +table 'Company Encoding' + isHidden + lineageTag: 9c90edc8-916f-43e8-9346-ce341fef5308 + + column ParameterValue + dataType: string + isHidden + lineageTag: f716da2e-0bce-4863-b541-a3d4eb862bdd + summarizeBy: none + sourceColumn: ParameterValue + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + column 'Encoded Company Name' + dataType: string + isHidden + lineageTag: 42e44aff-1524-47b8-b388-570cea27942b + summarizeBy: none + sourceColumn: Encoded Company Name + + changedProperty = IsHidden + + annotation SummarizationSetBy = Automatic + + partition 'Company Encoding' = m + mode: import + source = + let + Source = #table( + {"ParameterValue"}, + {{COMPANY}} + ), + #"Added Encoded Column" = Table.AddColumn(Source, "Encoded Company Name", each Uri.EscapeDataString(COMPANY), type text) + in + #"Added Encoded Column" + + changedProperty = IsHidden + + annotation PBI_NavigationStepName = Navigation + + annotation PBI_ResultType = Table + diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/tables/Sustainability Ledger Entries.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/tables/Sustainability Ledger Entries.tmdl index 5f52c399cc..d41b54e7a4 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/tables/Sustainability Ledger Entries.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sustainability app/Sustainability app.SemanticModel/definition/tables/Sustainability Ledger Entries.tmdl @@ -559,11 +559,11 @@ table 'Sustainability Ledger Entries' VAR BusinessCentral = "https://businesscentral.dynamics.com/" VAR TenantID = - VALUES ( 'Date Table Setup'[tenantID] ) //VAR TenantID = VALUES('Date Table Setup'[tenantID]) + VALUES ( 'Date Table Setup'[tenantID] ) VAR Environment = VALUES ( ENVIRONMENT[ENVIRONMENT] ) VAR Company = - "?company=" & VALUES ( COMPANY[COMPANY] ) + "?company=" & VALUES ( 'Company Encoding'[Encoded Company Name] ) RETURN BusinessCentral & TenantID & "/" & Environment & "/" & Company displayFolder: _Back Links From 109a12b8a125fa8bc07ba17bf43efa2729f3a04c Mon Sep 17 00:00:00 2001 From: Johnathan Gonzalez Date: Wed, 4 Mar 2026 17:09:54 +1000 Subject: [PATCH 10/10] hid company encoding table --- .../definition/tables/Company Encoding.tmdl | 9 +++++++++ .../definition/tables/Company Encoding.tmdl | 9 +++++++++ .../definition/tables/Company Encoding.tmdl | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Company Encoding.tmdl index 3b035d8a7d..77f6454109 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Company Encoding.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Finance app/Finance app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -1,20 +1,27 @@ table 'Company Encoding' + isHidden lineageTag: 9e6a9d70-a0a6-4618-87e3-fd62f05afb38 column ParameterValue dataType: string + isHidden lineageTag: fae850ad-94d1-42ad-8e46-5759ca39e7ed summarizeBy: none sourceColumn: ParameterValue + changedProperty = IsHidden + annotation SummarizationSetBy = Automatic column 'Encoded Company Name' dataType: string + isHidden lineageTag: 6f662f9a-0754-40be-b980-04f652e3d84b summarizeBy: none sourceColumn: Encoded Company Name + changedProperty = IsHidden + annotation SummarizationSetBy = Automatic partition 'Company Encoding' = m @@ -29,6 +36,8 @@ table 'Company Encoding' in #"Added Encoded Column" + changedProperty = IsHidden + annotation PBI_NavigationStepName = Navigation annotation PBI_ResultType = Table diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Company Encoding.tmdl index 18df7be69e..8a02aa7654 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Company Encoding.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Projects app/Projects app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -1,20 +1,27 @@ table 'Company Encoding' + isHidden lineageTag: dfa38049-b6a7-4985-b754-44ee9f836e32 column ParameterValue dataType: string + isHidden lineageTag: f37fc280-0a49-4975-9389-64f75aa2804f summarizeBy: none sourceColumn: ParameterValue + changedProperty = IsHidden + annotation SummarizationSetBy = Automatic column 'Encoded Company Name' dataType: string + isHidden lineageTag: d7542b24-c883-42e0-a7d8-7eef5455f11a summarizeBy: none sourceColumn: Encoded Company Name + changedProperty = IsHidden + annotation SummarizationSetBy = Automatic partition 'Company Encoding' = m @@ -29,6 +36,8 @@ table 'Company Encoding' in #"Added Encoded Column" + changedProperty = IsHidden + annotation PBI_NavigationStepName = Navigation annotation PBI_ResultType = Table diff --git a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Company Encoding.tmdl b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Company Encoding.tmdl index 41c2c89c73..46e5baf992 100644 --- a/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Company Encoding.tmdl +++ b/src/Apps/W1/PowerBIReports/Power BI Files/Sales app/Sales app.SemanticModel/definition/tables/Company Encoding.tmdl @@ -1,20 +1,27 @@ table 'Company Encoding' + isHidden lineageTag: 179fe678-f573-465e-a78e-bd4ced81294c column ParameterValue dataType: string + isHidden lineageTag: 6826bae4-1d98-4037-a748-0f4ebacf63ed summarizeBy: none sourceColumn: ParameterValue + changedProperty = IsHidden + annotation SummarizationSetBy = Automatic column 'Encoded Company Name' dataType: string + isHidden lineageTag: fbbe6b29-c8a7-4614-9247-de7cbffe05e0 summarizeBy: none sourceColumn: Encoded Company Name + changedProperty = IsHidden + annotation SummarizationSetBy = Automatic partition 'Company Encoding' = m @@ -29,6 +36,8 @@ table 'Company Encoding' in #"Added Encoded Column" + changedProperty = IsHidden + annotation PBI_NavigationStepName = Navigation annotation PBI_ResultType = Table