Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I have two tables: a sales table ( called 'Results' in the attached) and a table with targets ('Targets').
I would like to create a table, where I would like to see the sums for every manager. And also a column with targets for every manager, where the total is the sum of all the targets (i.e. 100)
So far I can add just the targets for every manager, but I do not know how to add the target total.
Please find the file attached:
Here are the steps you can follow:
Load Data:
Create Relationships:
Create Measures:
In the 'Results' table, create a measure to calculate the sum of sales for each manager. Let's call this measure 'Total Sales':
Total Sales = SUM('Results'[Sales])
In the 'Targets' table, create a measure to calculate the sum of targets for each manager. Let's call this measure 'Total Targets':
Total Targets = SUM('Targets'[Target])
Create another measure to calculate the overall target total. Let's call this measure 'Overall Target Total':
Overall Target Total = SUM('Targets'[Target])
Create a Table:
Display Overall Target Total:
Your table should now show the total sales and targets for each manager, as well as the overall target total.
Remember that the exact steps might vary slightly depending on your specific data model and requirements. If you encounter any issues or need further clarification, feel free to provide more details, and I'll do my best to assist you.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Hi @123abc ,
The particularity of the 'Results' table is that there is no 'Manager' field.
Even if there is one, the target total propagates to the 'Results' table as the total for all of the values.
If there is no 'Manager' field in the 'Results' table, and the target total needs to propagate to the 'Results' table, you can follow these modified steps:
Create Relationships: Ensure that there is a relationship between the 'Manager' column in the 'Targets' table and the 'Manager' column in the 'Results' table. If there is no direct 'Manager' column in the 'Results' table, you might need to use a related column or another common identifier.
Create a New Table: Go to the "Model" view and create a new table by going to "Modeling" > "New Table."
Write DAX Measures: In the new table, use DAX measures to calculate the sums for every manager and the target total.
TotalSales = SUM('Results'[Sales])
TotalTargets = SUM('Targets'[Target])
Display the Data in a Table: Now, you can create a table in the report view and add the 'Manager' column from the 'Results' table (or any related table) and the measures you created in step 3.
Manager Total Sales Total TargetsManager1 | [TotalSales for Manager1] | [TotalTargets] |
Manager2 | [TotalSales for Manager2] | [TotalTargets] |
... | ... | [TotalTargets] |
Replace [TotalSales for Manager1] and [TotalSales for Manager2] with the actual DAX expressions for calculating the total sales for each manager. Ensure that you use the appropriate related column or identifier to display the manager in the 'Results' table.
Propagate Target Total to Results Table: To propagate the total target to the 'Results' table, you can use a DAX measure that utilizes the RELATED function to fetch the total target.
TargetTotalForResults = RELATED('NewTable'[TotalTargets])
Add this measure to the 'Results' table to display the total target for each row in the 'Results' table.
Adjust the DAX expressions based on your actual column names and data model. If you encounter any specific issues or need further assistance, feel free to provide more details.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |