Forum Discussion
Creating a Table that Draws Values from Multiple Sources
- 1 year ago
Hi ZMcNealy,
In Power Query:
Unpivot both Budget and Expenditure tables (columns: Personnel, Fringe, Travel, Contractual).
Rename:
Attribute β Category
Value β Budget or Expended
- Merge the tables on Organization + Category.
- Add a column:
Remaining = [Budget] - [Expended]
In Power BI report:
Add a Slicer for Organization.
Add a Table visual with: Category, Budget, Expended, Remaining.
Let me know if you need further help on this.
βHope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
π‘Found it helpful? Show some love with kudos π β your support keeps our community thriving!
πLetβs keep building smarter, data-driven solutions together! π [Explore More]
Hi ZMcNealy
Thank you for reaching out to the Microsoft Community Forum
GrowthNatives Thank you for your prompt response
ZMcNealy ,
Step-by-Step Guide: Merging Budget and Expended Tables in Power BI
Step 1: Import the Data
Import your data tables into Power BI Desktop. You should have at least two tables:
Budget
Expended
Step 2: Unpivot Columns
For both the Budget and Expended tables:
Click on the table (Budget or Expended) in Power Query Editor.
Select the following columns: Personnel, Fringe, Travel, Contractual, etc.
Right-click and choose Unpivot Columns.
Rename the resulting columns:
Rename Attribute to Category
Rename Value to Budget or Expended accordingly for each table
Step 3: Merge the Tables
In Power Query Editor, go to Home > Merge Queries.
Merge the Expended table with the Budget table using appropriate join keys (e.g., Organization, Category, or any common identifier).
After merging, expand the Budget table inside the merged query.
Select only the relevant column (e.g., Budget) from the expanded list.
Note: Chage the data types for Budget & Expended
Step 4: Apply Changes and Load Data
Click Close & Apply to load the transformed data into the data model (Power Pivot).
Step 5: Create Measures
In the data model, create the following DAX measures:
SumOfBudget = SUM(MergedTable[Budget])
SumOfExpended = SUM(MergedTable[Expended])
Remaining = [SumOfBudget] - [SumOfExpended]
Step 6: Create Table Visual
Insert a Table visual on your report canvas.
Add the following fields to the table:
Category
SumOfBudget
SumOfExpended
Remaining
Step 7: Add a Slicer for Filtering
Insert a Slicer visual.
Drag a field like Organization into the slicer to allow filtering by organization.
If this solution helped resolve your query, kindly mark it as Accepted and consider giving a Kudos so it can assist others in the community facing similar issues.
Let me know if you need further assistance!
Thanks & Regards,
LakshmiNarayana.