Power BI Count重复ID的数量 [英] Power BI Count number of repeating ID

查看:1766
本文介绍了Power BI Count重复ID的数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算重复ID?我想把它放在新的列中,总数是否重复这样的示例真的没关系,(如果出来的话这会更好):

How do I count repeating ID? I want to put it on the new column, it really doesn't matter if the number of total is repeating example like (if out come is this then better):

==========|=
   10327  |2
   10327  |2
   10328  |3
   10328  |3
   10328  |3

推荐答案

使用这样的计算列:

NrOfOccurrences = CALCULATE(
    COUNT([OrderID]); 
    FILTER(Orders; [OrderID] = EARLIER('Orders'[OrderID])))

从下至上:


  • FILTER 每行为您提供一个表格,其中所有行都具有相同的 OrderID

  • COUNT 将计算 OrderID s的数量,有效地计算行数

  • CALCUL ATE 将它们放在一起,以便计算相关的 FILTER 表中的行数;

  • FILTER gives you a table per row that has all rows with the same OrderID
  • COUNT would count the number of OrderIDs, effectively the number of rows
  • CALCULATE puts them together, so that the number of rows in the relevant FILTER table is counted;

例如,这是手动输入的表格的屏幕截图:

For example this is a screenshot of a manually entered table:

这篇关于Power BI Count重复ID的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆