在 powerbi 报告中计算男性总数和女性总数

Calculate Total male Total Female in powerbi report

我想统计powerbi报表中男性和女性的总数

例如。

Name    Gender
std1    Female
std2    Male
std3    Female
std4    Male
std5    Male
std6    Male

我想要的结果是:

Female 2
Male   4

要获得您正在寻找的结果,请执行以下步骤:

  1. 使用“新建”Table 按钮和以下代码创建第二个 table:

    GenderCounts = DISTINCT(TableName[Gender])
    
  2. 从新创建的table建立关系回到原来的table

  3. 使用以下代码向 GenderCounts table 添加一个新列:

    Count = COUNTROWS(RELATEDTABLE(TableName))
    

还有第二个 table 包含每个性别的计数。

有关更多信息和其他可能性,请查看相关的 Power BI 社区论坛 post here and Whosebug questions and