diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al index ab8a26a39d..f84542e219 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al @@ -62,6 +62,7 @@ permissionset 36955 "Power BI Embedded - Objects" page "Inventory by Serial No." = X, page "PowerBI Bin Contents" = X, page "Bin Contents by Item Tracking" = X, + page "PowerBI ABC Analysis" = X, page "Projects Overview" = X, page "Project Tasks" = X, page "Project Profitability" = X, diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al index 1daaf790fa..9a8ad3d7f5 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al @@ -54,6 +54,7 @@ permissionset 36951 "PowerBi Report Basic" query "Resources - PBI API" = X, query "Assembly Headers - Order" = X, query "Assembly Lines - Item" = X, + query "ABC Analysis Setup - PBI API" = X, query Bins = X, query "Calendar Entries" = X, query "Capacity Ledger Entries" = X, diff --git a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al index 8244777958..32f2ee409e 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al +++ b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al @@ -121,6 +121,14 @@ pageextension 36962 "Warehouse Manager Role Center" extends "Warehouse Manager R RunObject = page "Inventory Forecasting"; Tooltip = 'Open the Power BI Report that predicts your inventory trends, including forecasting of quantity across item, location and inventory posting groups.'; } + action("ABC Analysis (Power BI)") + { + ApplicationArea = Basic, Suite; + Caption = 'ABC Analysis (Power BI)'; + Image = "PowerBI"; + RunObject = page "PowerBI ABC Analysis"; + Tooltip = 'Open the Power BI Report that performs an ABC analysis of your sales data, categorizing customers based on their contribution to total sales.'; + } } } } diff --git a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al index 2f7e04caba..151c33b3c5 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al +++ b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al @@ -121,6 +121,14 @@ pageextension 36956 "Whse. Basic Role Center" extends "Whse. Basic Role Center" RunObject = page "Inventory Forecasting"; Tooltip = 'Open the Power BI Report that predicts your inventory trends, including forecasting of quantity across item, location and inventory posting groups.'; } + action("ABC Analysis (Power BI)") + { + ApplicationArea = Basic, Suite; + Caption = 'ABC Analysis (Power BI)'; + Image = "PowerBI"; + RunObject = page "PowerBI ABC Analysis"; + Tooltip = 'Open the Power BI Report that performs an ABC analysis of your sales data, categorizing customers based on their contribution to total sales.'; + } } } } diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al b/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al new file mode 100644 index 0000000000..947e26e460 --- /dev/null +++ b/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al @@ -0,0 +1,36 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.Inventory.PowerBIReports; + +using Microsoft.Inventory.Analysis; + +query 37022 "ABC Analysis Setup - PBI API" +{ + Access = Internal; + Caption = 'Power BI ABC Analysis Setup'; + QueryType = API; + APIPublisher = 'microsoft'; + APIGroup = 'analytics'; + ApiVersion = 'v1.0'; + EntityName = 'abcAnalysisSetup'; + EntitySetName = 'abcAnalysisSetups'; + DataAccessIntent = ReadOnly; + + elements + { + dataitem(abcAnalysisSetup; "ABC Analysis Setup") + { + column(categoryA; "Category A") + { + } + column(categoryB; "Category B") + { + } + column(categoryC; "Category C") + { + } + } + } +} \ No newline at end of file diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/PowerBIABCAnalysis.Page.al b/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/PowerBIABCAnalysis.Page.al new file mode 100644 index 0000000000..17c4ce180b --- /dev/null +++ b/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/PowerBIABCAnalysis.Page.al @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.PowerBIReports; + +using System.Integration.PowerBI; + +page 37111 "PowerBI ABC Analysis" +{ + UsageCategory = ReportsAndAnalysis; + ApplicationArea = All; + PageType = UserControlHost; + Caption = 'ABC Analysis'; + AboutTitle = 'About ABC Analysis'; + AboutText = 'The ABC Analysis page provides insights into customer segmentation based on sales volume, helping to identify key customers and prioritize sales efforts.'; + + layout + { + area(Content) + { + usercontrol(PowerBIAddin; PowerBIManagement) + { + ApplicationArea = All; + + trigger ControlAddInReady() + begin + SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageLbl); + end; + + trigger ReportLoaded(ReportFilters: Text; ActivePageName: Text; ActivePageFilters: Text; CorrelationId: Text) + begin + SetupHelper.LogReportLoaded(CorrelationId); + end; + + trigger ErrorOccurred(Operation: Text; ErrorText: Text) + begin + SetupHelper.LogError(Operation, ErrorText); + SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText); + end; + } + } + } + + var + SetupHelper: Codeunit "Power BI Report Setup"; + ReportId: Guid; + ReportPageLbl: Label 'a476d6afc8d5d544193b', Locked = true; + + trigger OnOpenPage() + var + PowerBIReportsSetup: Record "PowerBI Reports Setup"; + begin + SetupHelper.EnsureUserAcceptedPowerBITerms(); + ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id")); + end; +} +