The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a table of sales data where each line is a line item from an order:
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:
Any thoughts how this might be accomplished?
Solved! Go to Solution.
Hi @michaelho
Try this:
Distinct Order Count =
DISTINCTCOUNT ( 'Table'[Order] )
- CALCULATE (
DISTINCTCOUNT ( 'Table'[Order] ),
FILTER ( 'Table', 'Table'[Order Type] = "Returns" )
)
Thank you, @danextian. That wasn't exactly what I was looking for, but I realize that this is probably a better solution.
Hi @michaelho
Try this:
Distinct Order Count =
DISTINCTCOUNT ( 'Table'[Order] )
- CALCULATE (
DISTINCTCOUNT ( 'Table'[Order] ),
FILTER ( 'Table', 'Table'[Order Type] = "Returns" )
)