Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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. | Date | Item | Customer ID |
| 1 | 17/11/2024 | A | 100 |
| 1 | 17/11/2024 | B | 100 |
| 1 | 17/11/2024 | C | 100 |
| 2 | 17/11/2024 | A | 100 |
| 2 | 17/11/2024 | B | 100 |
| 2 | 17/11/2024 | C | 100 |
| 3 | 17/11/2024 | A | 200 |
| 3 | 17/11/2024 | B | 200 |
| 3 | 17/11/2024 | C | 200 |
| 4 | 18/11/2024 | A | 100 |
| 4 | 18/11/2024 | B | 100 |
| 4 | 18/11/2024 | C | 100 |
Solved! Go to Solution.
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:
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. | Date | Item | Customer ID | Count Of invoices / Day / Customer |
| 1 | 17/11/2024 | A | 100 | 2 |
| 1 | 17/11/2024 | B | 100 | 2 |
| 1 | 17/11/2024 | C | 100 | 2 |
| 2 | 17/11/2024 | A | 100 | 2 |
| 2 | 17/11/2024 | B | 100 | 2 |
| 2 | 17/11/2024 | C | 100 | 2 |
| 3 | 17/11/2024 | A | 200 | 1 |
| 3 | 17/11/2024 | B | 200 | 1 |
| 3 | 17/11/2024 | C | 200 | 1 |
| 4 | 18/11/2024 | A | 100 | 1 |
| 4 | 18/11/2024 | B | 100 | 1 |
| 4 | 18/11/2024 | C | 100 | 1 |
Try this:
CountInvoicesColumn =
CALCULATE(
DISTINCTCOUNT('Table'[Invoice No.]),
ALLEXCEPT('Table', 'Table'[Date], 'Table'[Customer ID])
)
whats your expected output?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |