Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Maahmohammed
Helper I
Helper I

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
2 ACCEPTED SOLUTIONS

Try this:

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

View solution in original post

Bibiano_Geraldo
Super User
Super User

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:

Bibiano_Geraldo_0-1732008949015.png

 

View solution in original post

4 REPLIES 4
Bibiano_Geraldo
Super User
Super User

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:

Bibiano_Geraldo_0-1732008949015.png

 

Maahmohammed
Helper I
Helper I

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

Try this:

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

Shravan133
Super User
Super User

whats your expected output?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.