Forum Discussion
coliveira77
5 years agoFrequent Visitor
The Date table does not relate to another date table
Hello friends from Power Bi, For a week now I have been researching how to include a new table of interest rates and access according to the period of each line. Link to the PBIX files ...
- 5 years ago
Hello Friend DataInsights thanks for the help, I was able with this formala see the value of the adjustment, then I make another measurement for the final value.
1 Valor Reajuste =CALCULATE (LASTNONBLANKVALUE (fReajustes[adjustment date] , [sum_reajustes]),FILTER (ALL ( dCalendar[Date]),dCalendar[Date] <= MAX ( dbo[measure_date])))
DataInsights
Super User
5 years ago
Try this measure:
Adjusted Amount =
VAR vAmount =
SUM ( dbo[Fat_new] )
VAR vContract =
MAX ( Contracts[Contracts] )
VAR vDate =
MAX ( dCalendar[Date] )
VAR vMaxRateDate =
CALCULATE (
MAX ( fReajustes[adjustment date] ),
ALL ( fReajustes ),
fReajustes[adjustment date] <= vDate,
fReajustes[Contracts] = vContract
)
VAR vRate =
LOOKUPVALUE (
fReajustes[adjustment percetual],
fReajustes[Contracts], vContract,
fReajustes[adjustment date], vMaxRateDate
)
VAR vResult =
IF ( ISBLANK ( vRate ), vAmount, vAmount * vRate )
RETURN
vResult
coliveira77
5 years agoFrequent Visitor
Thanks for the help DataInsights, but when I apply it to my file, it comes up with another value, I did some variations without success.
- DataInsights5 years ago
Super User
Try breaking it down so you can see each component of the calculation. After RETURN in the measure, put vRate instead of vResult. This will display the rate being used. Do the same with each variable to identify the problem.
- coliveira775 years agoFrequent Visitor
Hello Friend DataInsights thanks for the help, I was able with this formala see the value of the adjustment, then I make another measurement for the final value.
1 Valor Reajuste =CALCULATE (LASTNONBLANKVALUE (fReajustes[adjustment date] , [sum_reajustes]),FILTER (ALL ( dCalendar[Date]),dCalendar[Date] <= MAX ( dbo[measure_date])))