Hello Every one
I've attached a pbix test file
i have a fact table and three dimension tables
each of dimension tables has a relationship with the fact table
i wanna subtract minimum assigning date from nearest higher regular add date and get the difference rounded to year like follows
|difference||regular add date||assign date|
and in the previous table if it found out that difference is 1 year i wanna time the wage from basic employee details in add rate in regular adds table but i need it like comulative
for example if i have base wage of 246 pounds and i got three adds for 2016 , 2017 and 2018 with add rate of 7% then the modified wage would be
2015 = 246
2016 = 263.22
2017 = 281.65
2018 = 301.36 ...etc
if anyone could help i would be very grateful
Hi @Islam ,
Create the following measure:
Wage growth = VAR MinimumYear = MINX ( ALLSELECTED ( dtblRegularAdds ), YEAR ( dtblRegularAdds[DecImpDate] ) ) VAR currentyear = YEAR ( MAX ( dtblRegularAdds[DecImpDate] ) ) VAR growthRate = 0.07 VAR Result = SUM ( dtblBasicEmpInfo[Wage] ) * ( 1 + growthRate ) ^ ( currentyear - MinimumYear ) RETURN Result
Result in attach PBIX and image below:
this is awesome bro but what about the date difference check
I mean only for test purpose i modified the assigning date to 1/6/2014 like next picture
then the difference between assigning date will be a year if compared to DecImpDate Like following picture
so the resulted regular add in 1/7/2015 should be 246*1.05 not just 246 like following picture
I'm sorry i can't understand this measure you provided but if you recommend any tutorials about this issue after modifying the measure to apply the date difference condition
sorry sir for bothering
Hi @Islam ,
Sorry but from you calculation in the first post I did not understood that the rate was different and that you had the different date check.
Try the following formula:
Wage growth = VAR MinimumYear = MINX ( ALLSELECTED ( dtblassignmentDec[Decision Apply Date] ), YEAR ( dtblassignmentDec[Decision Apply Date]) ) VAR currentyear = YEAR ( MAX ( dtblRegularAdds[DecImpDate] ) ) VAR growthRate = SUM(dtblRegularAdds[PromotionRate]) VAR Result = SUM ( dtblBasicEmpInfo[Wage] ) * ( 1 + growthRate ) ^ ( currentyear - MinimumYear ) RETURN Result
Thanks sir i checked the file and i found the following
Assign apply date is 2/8/2014
First regular add date is 1/7/2015
So the difference between them is less than one year
Then the base wage shouldn't raise by the regular add of 2015 while in your suggested answer file it raised in 2015 which is not correct
I'm so sorry bothering sir
Hi @Islam ,
I'm a little bit lost about what is the calculation and how you are making it, because the calculations match the values you present on previous post.
Can you share a calculation with all this options so i can check what is the expected result the different cases, so when value is less than one year, and the percentage changes an so on.
Sorry for all the questions.
really appreciate it sir
just to confirm, is this measure testing the difference date between minimum date in both assigning date and regular adds date and the nearest uuper date to it and it is year or more then will calculate the regular add rate on the wage otherwise it displays only the previous wage ?
Click here to read more about the June 2022 updates!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!
Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.