Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Betissa
Helper I
Helper I

Difference problem

I am very new in this world of power BI,
Here is my problem: I wanted to calculate the difference between two columns on each column in a different table, here is the formula I use    Ecart2 = ifp_vte1[Mt HT] - RealiseN[Mt HT],
And this reminds me of the following error:   It is impossible to determine a unique value for the 'Mt HT' column of the 'ifp_vte1' table. This can occur when a measurement formula refers to a column that contains many values, without specifying aggregation such as min, max, count, or sum to get a single result.

1 ACCEPTED SOLUTION

Hi @Betissa,

 

According to your description and the table structure you provided above, I would suggest you to use Merge Query option to merge the "ifp_vte1" table and "RealiseN" table to a single table first, then you should be able to use the formula below to create a calculate column to calculate the difference.

Ecart2 = newMergedTable[Mt HT1] - newMergedTable[Mt HT2]

For more details about how to use Merge Query option in Power BI Desktop, please refer to this article.Smiley Happy

 

Regards

View solution in original post

4 REPLIES 4
BetterCallFrank
Resolver IV
Resolver IV

Hi @Betissa,

are there any relationships between your tables in the model?

Can you provide a screenshot of the relationship-view and/or some sample data of what the tables look like?

 

Frank

No there is no relationship

diff.png

 

 

 

Hi @Betissa,

 

According to your description and the table structure you provided above, I would suggest you to use Merge Query option to merge the "ifp_vte1" table and "RealiseN" table to a single table first, then you should be able to use the formula below to create a calculate column to calculate the difference.

Ecart2 = newMergedTable[Mt HT1] - newMergedTable[Mt HT2]

For more details about how to use Merge Query option in Power BI Desktop, please refer to this article.Smiley Happy

 

Regards

Baskar
Resident Rockstar
Resident Rockstar

Cool,

 

1. Without relate the table how can we create calculation ?

 

2. If u create calculated measure u should define the Agregation it is must.

 

My Suggestion :

 

Create relationship between these two tables  and try.

 

or

U don't want relationship . u want only Difference ?  then use sum() infront of column

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.