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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
5mvn
New Member

Subtract 2 different data

Hello everybody! I wanted to ask for help because like many of you I come from Excel and I am having a hard time learning how to formulate in powerBI. First of all forgive me if it is very obvious!

 

I have two tables:

- Table A: year of entry, number of registrations. I have calculated it as COUNT(Date of entry)

- Table B: year of leave, number of leaves. I have calculated it as COUNT(Date of leaving)

 

I would like to create a net growth chart (Table A - Table B) but I am unable to relate the data for the formula "Table A" - "Table B" and the result of this subtraction gives me 0.

 

In this example it should subtract me at least 2018, but it fails to link one subtraction to another.

 

5mvn_2-1689155214605.png

Could you help me?

 

Thanks in advance!

4 REPLIES 4
Nithinr
Resolver III
Resolver III

can you please share pbix file if possible, just curious how you are calculating variance, is it a column based substraction like below

column='Table (2)'[data1]-RELATED('Table'[Data])

Hi Nithinr, thanks again for your time. This is the most accurate formula I have done, but it does not work still:

 

CALCULATE(COUNT(Sheet1[Year of registration]),Sheet1[Incorporation date])-calculate(COUNT(Sheet1[Year of leave]),Sheet1[Leave date])
 
Here I realized the problem lies not with the formula but within the graphic that shows Registration-Leaves, because I created in excel a new column that can relate registration and leaves in the same year so that it can show in the graphic both data with the same info. I created this column in excel:

=IF((yearofleave)>=2018;year(yearofleave);if(hiringyear=0;"";year(hiringyear)))
 
The problem is that now I show as "2023" people that got hired in 2010 -for example- but their leave year is 2023. So 2023 does not only show people that got hired in 2023 but also people that left the company this year.
 
Thats why when I do in powerBI the substraction the final result does not match, so I guess the solution is to either create a column that can relate both years correctly or to face the problem with a different approach
Nithinr
Resolver III
Resolver III

Check if the relationships are configured between two tables. let me know if you are still getting the same variance.

re.pngrelation.png

Yeah, still same problem, thanks though! I even tried moving all to the same table so now I have everything in one table and still doesn't work

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors