我如何获得具有动力支点的百分比字段? [英] How can I get a percentage field with power pivot?

查看:39
本文介绍了我如何获得具有动力支点的百分比字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Power Pivot用户,这应该是一个相当简单的问题,因为我是新手.我正在尝试执行以下操作.枢转表格后,我得到一个像这样的交叉表表格

This should be a fairly easy question for Power Pivot users since I'm a newbie. I am trying to do the following. After pivoting a table I get a crosstab table like this

rating         count of id
A              1
B              2
Grand Total    3

您可以想象原始表只有两列(等级和ID)和三行(A代表1个ID,B代表两个不同的ID).为了创建简单显示的度量,我必须写什么DAX公式

You can imagine the original table only has two columns (rating and id) and three rows (1 id for A and two different id's for the B rating). What DAX formula do I have to write in order to create a measure that simply shows

rating         percent of id
A              1/3
B              2/3
Grand Total    3/3

我的1/3当然是0.3333,我这样写是为了让我很清楚,我只希望id的百分比是每个评分的计数除以总计数.非常感谢

By 1/3 of course I mean 0.3333, I wrote it like that so that it is clear that I simply want that percent of id is the count for each rating divided by the total count. Thank you very much

推荐答案

您需要将每一行的计数除以总计数.

You need to divide the count for each row by the total count.

DIVIDE (
    COUNT ( Table1[ID] ),
    CALCULATE ( COUNT ( Table1[ID] ), ALL ( Table1 ) )
)


对于此特定计算,您不必编写DAX.您只需在值字段设置"中进行设置即可.


For this particular calculation, you don't have to write DAX though. You can just set it in the Value Field Settings.

Summarize Value By  :  Count
Show Values As      :  % of Column Total

这篇关于我如何获得具有动力支点的百分比字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆