Forum Discussion

JoyceW's avatar
JoyceW
Helper II
4 years ago
Solved

Distinct count and then create groups

Hi,   I'm looking for some help.    I have a table with ordernumbers and invoicenumbers. Ordernumber is unique, but one order can have more invoicenumbers.  So for example:   Invoicenumber ...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    One of ways to create this is having a Grouping table like below.

    Please check the below picture and the attached pbix file.

     

     

    Invioce count group measure: = 
    COUNTROWS (
        FILTER (
            VALUES ( Data[Ordernumber] ),
            [Count of invoice measure:] >= MIN ( 'Grouping'[min] )
                && [Count of invoice measure:] <= MAX ( 'Grouping'[max] )
        )
    ) + 0