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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
michaelho
Frequent Visitor

Find distinct order count and make some negative

I have a table of sales data where each line is a line item from an order:

michaelho_0-1665705140257.png

 

I'm trying to get a distinct order count (since there can be multiple lines per order) BUT I want to change the Return orders to a negative number so the end result looks something like this:

 

michaelho_1-1665705300765.png

 

Any thoughts how this might be accomplished?

 

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @michaelho 

 

Try this:

Distinct Order Count =
DISTINCTCOUNT ( 'Table'[Order] )
    - CALCULATE (
        DISTINCTCOUNT ( 'Table'[Order] ),
        FILTER ( 'Table', 'Table'[Order Type] = "Returns" )
    )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
michaelho
Frequent Visitor

Thank you, @danextian. That wasn't exactly what I was looking for, but I realize that this is probably a better solution.

danextian
Super User
Super User

Hi @michaelho 

 

Try this:

Distinct Order Count =
DISTINCTCOUNT ( 'Table'[Order] )
    - CALCULATE (
        DISTINCTCOUNT ( 'Table'[Order] ),
        FILTER ( 'Table', 'Table'[Order Type] = "Returns" )
    )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors