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.
hi, i have two tables , one is a branch table wichh includ the branch name and profit target.
and another table wich inculde branche and total profit.
i whant to create a colum tahat make a "branch profit targer - total profit.
for example: cranch number one - the profit target is 1500
and the total profit is 2100
i whant to to 2100 - 1500 = 600
so the colum will show "600".
thanks for respondes.
david.
Solved! Go to Solution.
Medeling tab => New Table
Summary Table = SUMMARIZE ( 'TotalProfit', 'TotalProfit'[Branch Name], 'TotalProfit'[Date], "Profit", CALCULATE ( SUM ( TotalProfit[Profit] ) ), "Target", LOOKUPVALUE ( 'Targets'[Target], 'Targets'[Branch Name], 'TotalProfit'[Branch Name], 'Targets'[Date], 'TotalProfit'[Date] ) )
then in this new Summary Table create a column
Column = 'Summary Table'[Profit] - 'Summary Table'[Target]
Create a Column in your 'Another Table' (I've assumed the 2 tables are related by Branch)
Over/Under = 'Another Table'[Total Profit] - RELATED('Branch Table'[Profit Target])
Hope this helps!
hi, i get this error:
A single value for column 'totalprof' in table 'totalprofit' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
what to do?
The above is a Column formula you are creating a Measure that's why you are getting that error.
select the Table you want the column to be created in - click New Column and then enter the formula
its not working for me 😞
now this error:
The column 'target[target]' either doesn't exist or doesn't have a relationship to any table available in the current context.
please help me
Are the 2 tables related?
they have a relationship thru another table but they are no related. should i try to related them?
its imposible to related them because non of this table have a uniqe value. they have a relationship only thru branches table.
its must be a direct relationship?
Okay then forget about the relationship
Create this Profit Target COLUMN in your 'Another Table'
Profit Target COLUMN = CALCULATE ( LOOKUPVALUE ( 'Branch Table'[Profit Target], 'Branch Table'[Branch Name], VALUES ( 'Another Table'[Branch] ) ) )
Then you just subtract the 2 columns
Over/Under = 'Another Table'[Total Profit] - 'Another Table'[Profit Target COLUMN]
Hope this helps!
didnt work for me. attach a picture
Medeling tab => New Table
Summary Table = SUMMARIZE ( 'TotalProfit', 'TotalProfit'[Branch Name], 'TotalProfit'[Date], "Profit", CALCULATE ( SUM ( TotalProfit[Profit] ) ), "Target", LOOKUPVALUE ( 'Targets'[Target], 'Targets'[Branch Name], 'TotalProfit'[Branch Name], 'Targets'[Date], 'TotalProfit'[Date] ) )
then in this new Summary Table create a column
Column = 'Summary Table'[Profit] - 'Summary Table'[Target]
tanks you !! its work for me 🙂 thanks for this great solution.
hi, when i tried to calculate this in a tables with more than one ling' i got this error: "A table of multiple values was supplied where a single value was expected."
there is a snapshot
please help me with this. thanks.
hi, when i tried to calculate this in a tables with more than one ling' i got this error: "A table of multiple values was supplied where a single value was expected."
there is a snapshot
please help me with this. thanks.
How about making a combined table. You can do this in the Query Editor as well as in DAX.
If you post more detail about your table structure, we can probably provide clearer step by step instructions.
ok its go like this:
table 1 - named "brances" - contain the brances names
table 2 named "total profit" and contain the branch name , the month, and the total profit for month
table 3 named "targets" contain the branch name , the month ' and the target.
there is a relationship between "brances" and "total profit" with the colum "branch name"
and there is a relationship between "targets" and "brances" with the colum "branch name"
so if i choose a brach from the "branche" table' i got the numbers of the target and the total profit ok.
not i just whant to creatr a colum that will make the callculate between total profit - target.
thank you vry much for your help.
Hi @davidi4524,
Do you have relationships setup between the two tables? So this is a direct relationship, not one that passes through another table.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |