Forum Discussion
5mvn
3 years agoNew 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! ...
Nithinr
3 years agoResolver 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])
5mvn
3 years agoNew Member
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)))
=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