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
Anonymous
Not applicable

Create a new column by using two different table values

I am new to power BI. I have 2 tables. One is primary and other one is backup. Both the table has progress columns. What I want is new column which is the difference of those two columns. I tried few options but couldnt find a solution.

 

My end goal is, I want to create a graph based on each task progress. Any suggestions will be helpful

 

One of the option I tried.

New Column =
var JoinCol = 'Table1'[Task]
var NewCol = CALCULATE((Table1[Progress]-Table2[Progress]),'Table2'[Task]=JoinCol)
return NewCol

 

3 REPLIES 3
dax
Community Support
Community Support

Hi @Anonymous , 

If possible could you please inform me more detailed information(such as your expected output and your sample data )? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

az38
Community Champion
Community Champion

@Anonymous 

do you have relationships between tables?

In the most common case and 1:1 relations it should be the simpliest option like

New Column = Ta2le1[Progress] - Table1[Progress]

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
amitchandak
Super User
Super User

@Anonymous , Try like

 

New Col in Table 1= 'Table1'[Progress] - sumx(filter('Table2','Table1'[Task] = 'Table2'[Task] ),'Table2'[Progress])

or
New Col in Table 2= 'Table2'[Progress] - sumx(filter('Table1','Table1'[Task] = 'Table2'[Task] ),'Table1'[Progress])

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.