简体   繁体   English

在矩阵中创建列,该列是Power BI中其他两个列的值的比率

[英]Create column in matrix that is a ratio of the values of two other columns in Power BI

I have a matrix that has the total premiums for each year, and total commissions for each year. 我有一个矩阵,其中包含每年的总保费和每年的总佣金。

I would like a third column that shows what the ratio for total commissions to total premiums is for each year. 我想在第三列中显示每年的总佣金与总保费之比。 I thought this would be easy but the values I get aren't right at all. 我以为这很容易,但是我得到的价值观根本不对。 Here's the formula I tried: 这是我尝试的公式:

Current formula 当前公式
当前公式

And here's how the column, Gross Commission %, came out: 以下是总佣金百分比列的显示方式:

Current table 当前表
当前表

Obviously this is all wrong. 显然,这都是错误的。 I've tried using DIVIDE([Gross Commission (+ve)],[Gross Written Premium]) instead but that didn't work either. 我尝试使用DIVIDE([总佣金(+ ve)],[总书面保费])来代替,但这也不起作用。

Obviously I've scrambled all of the premium and commission data before posting here so what you see is not real-world data, but it's exactly the same for the real data. 显然,在发布此处之前,我已经对所有溢价和佣金数据进行了加扰,因此您看到的不是真实数据,但对于真实数据来说完全相同。

I would use the same formula, but created as a Measure, not a Column. 我将使用相同的公式,但是将其创建为度量而不是列。 So from PBI Desktop's Modeling ribbon, click New Measure. 因此,从PBI Desktop的Modeling功能区中,单击New Measure。

Then the calculation will run after the default Sum calculation has occurred on the other columns, and will obey the context of the Year. 然后,该计算将在其他列上进行了默认的总和计算后运行,并且将遵循Year的上下文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM