使用指标计算前瞻利率。

huangapple go评论61阅读模式
英文:

Calculate a forward rate using measure

问题

"Forward Rate" 指的是每一行的计算方式,即 Discount Factor 当月 / Discount Factor 前一个月 - 1。

您尝试使用以下公式,但似乎不起作用:

Forward Rate = SUMX(facYieldCurves, 
IFERROR( 
    DIVIDE(LOOKUPVALUE(facYieldCurves[Discount Factor], facYieldCurves[Month] , [Month] - 1) , [Discount Factor]),0))
英文:

I have a table of the following format:

使用指标计算前瞻利率。

I need to calculate a "Forward Rate" measure for each row, which = Discount Factor Current Month / Discount Factor Proceeding Month - 1.

I have tried the following measure but it does not work:

Forward Rate = SUMX(facYieldCurves, 
IFERROR( 
    DIVIDE(LOOKUPVALUE(facYieldCurves[Discount Factor], facYieldCurves[Month] , [Month] - 1) , [Discount Factor]),0)) 

答案1

得分: 1

你的意思是这样吗?

使用指标计算前瞻利率。

Measure =
IF(HASONEVALUE('Table'[Month]),
DIVIDE(
MAX('Table'[Discount Factor]),
CALCULATE(MAX('Table'[Discount Factor]), REMOVEFILTERS(), VALUES('Table'[Curve]), 'Table'[Month]=MAX('Table'[Month])-1),
0
)
)

英文:

You mean like this?

使用指标计算前瞻利率。

Measure = 
IF(HASONEVALUE('Table'[Month]), 
    DIVIDE(
        MAX('Table'[Discount Factor]),
        CALCULATE(MAX('Table'[Discount Factor]), REMOVEFILTERS(), VALUES('Table'[Curve]), 'Table'[Month]=MAX('Table'[Month])-1),
        0
    )
)

huangapple
  • 本文由 发表于 2023年3月3日 22:05:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/75628086.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定