Forum Discussion

Maahmohammed's avatar
Maahmohammed
Helper I
1 year ago
Solved

Measure & Calculated filed

Dears,

I have the below table & I'd like to have a measure & a calculated column code to get the count of invoices  / Customers / Day

Appreciating your support.

Invoice No.DateItemCustomer ID
117/11/2024A100
117/11/2024B100
117/11/2024C100
217/11/2024A100
217/11/2024B100
217/11/2024C100
317/11/2024A200
317/11/2024B200
317/11/2024C200
418/11/2024A100
418/11/2024B100
418/11/2024C100
  • Shravan133's avatar
    Shravan133
    1 year ago

    Try this:

    CountInvoicesColumn =
    CALCULATE(
    DISTINCTCOUNT('Table'[Invoice No.]),
    ALLEXCEPT('Table', 'Table'[Date], 'Table'[Customer ID])
    )

  • Hi Maahmohammed ,
    You can create a measure to calculate DISTINCT invoices by this DAX:

    InvoiceCountMeasure = 
    CALCULATE(
        DISTINCTCOUNT('YourTable'[Invoice No.]),
        ALLEXCEPT('YourTable', 'YourTable'[Customer ID], 'YourTable'[Date])
    )

     

    You result will look like this:

     

4 Replies

  • Hi Maahmohammed ,
    You can create a measure to calculate DISTINCT invoices by this DAX:

    InvoiceCountMeasure = 
    CALCULATE(
        DISTINCTCOUNT('YourTable'[Invoice No.]),
        ALLEXCEPT('YourTable', 'YourTable'[Customer ID], 'YourTable'[Date])
    )

     

    You result will look like this:

     

  • Having the below new column

    Invoice No.DateItemCustomer IDCount Of invoices / Day / Customer
    117/11/2024A1002
    117/11/2024B1002
    117/11/2024C1002
    217/11/2024A1002
    217/11/2024B1002
    217/11/2024C1002
    317/11/2024A2001
    317/11/2024B2001
    317/11/2024C2001
    418/11/2024A1001
    418/11/2024B1001
    418/11/2024C1001
    • Shravan133's avatar
      Shravan133
      Super User

      Try this:

      CountInvoicesColumn =
      CALCULATE(
      DISTINCTCOUNT('Table'[Invoice No.]),
      ALLEXCEPT('Table', 'Table'[Date], 'Table'[Customer ID])
      )