首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何对power BI原始数据进行聚类

如何对power BI原始数据进行聚类
EN

Stack Overflow用户
提问于 2020-01-16 11:28:25
回答 1查看 32关注 0票数 0

我有原始数据集

代码语言:javascript
复制
Category    Month   Revenue Expected Result based on condition  Revenue Bucket
A   1   10  if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   more than 10
A   2   5   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   more than 10
A   3   2   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   more than 10
B   1   0   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   0
B   2   0   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   0
B   3   0   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   0
C   1   2   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   1-10
C   2   5   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   1-10
C   3   2   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   1-10
D   1   12  if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   more than 10
D   2   3   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   more than 10
D   3   2   if(sum of category is 0 then 0, else if sum of category >0 and <10 , then 1-10, else more than 10   more than 10

根据收益情况,收益桶是我的预期产出。

我的代码

代码语言:javascript
复制
Revenue_Bucket = if(CALCULATE(SUM('Spend by Client'[Revenue]))=0,"$0",if(CALCULATE(SUM('Spend by Client'[Revenue]))<10,"$1-10","More than 0"))

我尝试使用DAX,但它对我没有帮助。你能帮帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2020-01-16 13:26:49

首先,sum of category不起作用,因为类别不是数字的。伯爵可以工作,但我不知道你想在那里做什么。

如果你想要一个基于你的收入列的集群,你可以在dax中像这样添加。首先添加一个新列,并使用以下dax表达式:

代码语言:javascript
复制
= IF('Spend by Client'[Revenue] = 0; "$0"; IF('Spend by Client'[Revenue] < 10; "$1-10"; "More than 10")

如果你想覆盖更多的类别,你可以频繁地嵌套if。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59762646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档