如何根据对象键值对计算总值并显示在卡片中 - PowerBI
How to calculate the total value based on object key value pair and show it in card - PowerBI
尝试使用 PowerBI 创建报告,我可以在其中轻松上传 JSON 文件并毫无问题地填充数据。由于我是 powerBI 的新手,我无法获得有关我的问题的正确信息。
下面是我的示例 JSON 数据。我想在卡片视图中显示不同的状态计数,(即)需要显示客户总数、活跃、不活跃、暂停等
{
"cutomerConList": [
{
"custID": "asd",
"conStatus": "Active"
},
{
"custID": "asd",
"conStatus": "Active"
},
{
"custID": "iyu",
"conStatus": "InActive"
},
{
"custID": "fsd",
"conStatus": "Suspended"
},
{
"custID": "asd",
"conStatus": "Hold"
},
{
"custID": "awe",
"conStatus": "Hold"
},
{
"custID": "bnn",
"conStatus": "Hold"
},
{
"custID": "err",
"conStatus": "Suspended"
},
{
"custID": "zxcvx",
"conStatus": "Active"
},
{
"custID": "iuo",
"conStatus": "Suspended"
},
{
"custID": "gfytr",
"conStatus": "Active"
},
{
"custID": "jfghj",
"conStatus": "Active"
},
]
}
由于文档含糊不清,无法找到解决方案。有人可以告诉我如何实现吗?
谢谢
此处:
countOf = COUNTROWS(VALUES(j[cutomerConList.custID]))
Hold = CALCULATE(COUNTROWS(VALUES(j[cutomerConList.custID])), all(j), j[cutomerConList.conStatus] = "Hold")
尝试使用 PowerBI 创建报告,我可以在其中轻松上传 JSON 文件并毫无问题地填充数据。由于我是 powerBI 的新手,我无法获得有关我的问题的正确信息。
下面是我的示例 JSON 数据。我想在卡片视图中显示不同的状态计数,(即)需要显示客户总数、活跃、不活跃、暂停等
{
"cutomerConList": [
{
"custID": "asd",
"conStatus": "Active"
},
{
"custID": "asd",
"conStatus": "Active"
},
{
"custID": "iyu",
"conStatus": "InActive"
},
{
"custID": "fsd",
"conStatus": "Suspended"
},
{
"custID": "asd",
"conStatus": "Hold"
},
{
"custID": "awe",
"conStatus": "Hold"
},
{
"custID": "bnn",
"conStatus": "Hold"
},
{
"custID": "err",
"conStatus": "Suspended"
},
{
"custID": "zxcvx",
"conStatus": "Active"
},
{
"custID": "iuo",
"conStatus": "Suspended"
},
{
"custID": "gfytr",
"conStatus": "Active"
},
{
"custID": "jfghj",
"conStatus": "Active"
},
]
}
由于文档含糊不清,无法找到解决方案。有人可以告诉我如何实现吗?
谢谢
此处:
countOf = COUNTROWS(VALUES(j[cutomerConList.custID]))
Hold = CALCULATE(COUNTROWS(VALUES(j[cutomerConList.custID])), all(j), j[cutomerConList.conStatus] = "Hold")