计算运行计数和长期数据的百分比
我有一个看起来像这样的数据集:
ID_SALE | 产品 | 商店 |
---|---|---|
SE_056 | AAA | NORTH |
XT-558 | AAA | NORTH |
8547Y | AAA NORS | NORTH |
TY856 | BBB | 北 |
D-895 | BBB | 北 |
BBB South Er5H | CCC | South |
CCC South 5f6f-gd ccc ccc ccc ccc ccc ccc ccc ccc ccc | ccc cc cc | ccc ccc |
cc cc cc cc cc cc | ccc c ccc | c |
5f | occc | South |
很多希望能够绘制一个将显示每个的计数的表product
以及每个product
的全球百分比以及类似的累积百分比的贡献:
产品 | 次序 | 百分比 | 运行% |
---|---|---|---|
AAA | 3 | 0,33333333 | 0,333333333 |
BBB | 2 | 0 ,22222222 | 0,5555556 |
CCC | 2 | 0,22222222 | 0,77777778 |
TTT | 1 | 0,11111111 | 0,888888889 |
UUU | 1 | 0,1111111 | 1 |
我还希望能够在PowerBi表中使用一个过滤器,该过滤器将通过store
过滤,因此,如果我选择“ north”我的桌子将显示以下内容:
产品 | 小计 | 百分比 | 运行% |
---|---|---|---|
AAA的 | 3 | 0,75 | 0,75 |
BBB | 1 | 0,25 | 1 |
,尽管我已经使用了快速量化功能要获得累积总数,我可以将其排序以按我的数据进行排序,因此我认为DAX是唯一的方法。
I have a dataset that looks like so:
ID_SALE | PRODUCT | STORE |
---|---|---|
SE_056 | AAA | NORTH |
XT-558 | AAA | NORTH |
8547Y | AAA | NORTH |
TY856 | BBB | NORTH |
D-895 | BBB | SOUTH |
ER5H | CCC | SOUTH |
5F6F-GD | CCC | SOUTH |
65-FFD | TTT | SOUTH |
56-YU | UUU | SOUTH |
I want to be able to plot a table that will show the count of each PRODUCT
and the contribution of the global percentage of each PRODUCT
as well as the cumulative percentage like so:
PRODUCT | Subtotal | Percentage | running % |
---|---|---|---|
AAA | 3 | 0,33333333 | 0,33333333 |
BBB | 2 | 0,22222222 | 0,55555556 |
CCC | 2 | 0,22222222 | 0,77777778 |
TTT | 1 | 0,11111111 | 0,88888889 |
UUU | 1 | 0,11111111 | 1 |
I also want to be able to have a filter in the PowerBI sheet that will filter by STORE
so if I choose "NORTH" my table will show the following:
PRODUCT | Subtotal | Percentage | running % |
---|---|---|---|
AAA | 3 | 0,75 | 0,75 |
BBB | 1 | 0,25 | 1 |
Although I have used the quick-measure feature to get the cumulative total I get get it to sort in order my data and so I figured that DAX is the only way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您的表被命名为“表”。
Assuming your table is named "Table".