切片器将数据集POWER BI

时间:2019-03-15 13:22:01

标签: powerbi powerbi-desktop powerbi-datasource

在使用Push数据集时,我在PowerBI Dektop和Service中遇到了一个非常特殊的情况。

创建带有多个表和用于过滤这些表的公用表的Push数据集,并在切片器中使用filters表后,一旦选择了要过滤的值,数据集中的记录数就会增加一倍。

我的数据集架构:

{
  "name": "DemoPushDataSetRelationships",
  "tables": [
    {
      "name": "Record",
      "columns": [
        {
          "name": "RecId",
          "dataType": "string"
        },
        {
          "name": "SiteId",
          "dataType": "string"
        },
        {
          "name": "UnitSystemId",
          "dataType": "string"
        },
        {
          "name": "UnitId",
          "dataType": "string"
        },
        {
          "name": "RecordType",
          "dataType": "string"
        },
        {
          "name": "MessageTimeStamp",
          "dataType": "DateTime"
        }
      ]
    },
    {
      "name": "Record",
      "columns": [
        {
          "name": "RecId",
          "dataType": "string"
        },
        {
          "name": "SiteId",
          "dataType": "string"
        },
        {
          "name": "UnitSystemId",
          "dataType": "string"
        },
        {
          "name": "UnitId",
          "dataType": "string"
        },
        {
          "name": "Value",
          "dataType": "decimal"
        },
        {
          "name":"Status",
          "dataType": "string"
        }
      ]
    },
    {
      "name": "Record",
      "columns": [
        {
          "name": "RecId",
          "dataType": "string"
        },
        {
          "name": "Status",
          "dataType": "string"
        },
        {
          "name": "SiteId",
          "dataType": "string"
        },
        {
          "name": "UnitSystemId",
          "dataType": "string"
        },
        {
          "name": "UnitId",
          "dataType": "string"
        }        
      ]
    },
    {
      "name": "CommonFiltersTable",
      "columns": [
        {
          "name": "SiteId",
          "dataType": "string"
        },
        {
          "name": "UnitSystemId",
          "dataType": "string"
        },
        {
          "name": "UnitId",
          "dataType": "string"
        }        
      ]
    }, 
  ],
  "relationships":[
    {
      "name": "FK_CommonFiltersTable_Record",
      "fromTable": "CommonFiltersTable",
      "fromColumn": "UnitId",
      "toTable": "ProductionData",
      "toColumn": "UnitId",
      "crossFilteringBehavior": "bothDirections"
    },
    {
      "name": "FK_CommonFiltersTable_Record",
      "fromTable": "",
      "fromColumn": "UnitId",
      "toTable": "CommonFiltersTable",
      "toColumn": "UnitId",
      "crossFilteringBehavior": "bothDirections"
    },
    {
      "name": "FK_CommonFiltersTable_Record",
      "fromTable": "KpiData",
      "fromColumn": "UnitId",
      "toTable": "CommonFiltersTable",
      "toColumn": "UnitId",
      "crossFilteringBehavior": "bothDirections"
    }
  ]
}

例如,我在一个表中有30行,应用切片器后,行数突然变为60。

关于发生这种情况以及如何处理/绕过它的任何想法或解释?

0 个答案:

没有答案