cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

count of single SKU orders

I'm trying to come up with a pivot (matrix) with [SKU] or rows that displays the number of Total Orders involving that SKU, and the number of single-SKU Orders.  My data consists of [Date][OrderID][SKU] and [Qty] fields.

My DAX formula of:

nSingle-SKU Orders := COUNTROWS(FILTER(SUMMARIZE(Table,Table[OrderID],"nLines",COUNTA([SKU]),"TotalQty",SUM([Qty])),[nLines]=1))

only returns the number of total orders involving the SKU on that row, instead of those where it is the ONLY SKU for the order.

The row filter of the SKU doesn't allow the formula to see/count all the rows of the orders.

1 ACCEPTED SOLUTION
New Member

That's it!!!  This is GREAT!  Exactly what I was looking for... and it's fast

Thanks so much for taking the time to help me out.

5 REPLIES 5
Super User

Hi @TrebligC,

This is the simplest measure I can think of (I've named the table Orders)

```Number of Single-SKU Orders =
COUNTROWS (
FILTER (
VALUES ( Orders[OrderID] ),
CALCULATE ( DISTINCTCOUNT ( Orders[SKU] ), ALL ( Orders[SKU] ) ) = 1
)
)```

Output looks like:

Owen Auger
Blog
New Member

That's it!!!  This is GREAT!  Exactly what I was looking for... and it's fast

Thanks so much for taking the time to help me out.

Community Champion
As per my understanding, you are trying to calculate the total number of orders for a particular
SKU.
Thanks & Regards,
Bhavesh

Love the Self Service BI.
New Member
No. My question is how do I count the number of orders that have only one SKU which is the SKU that is on the row of the pivot... single-SKU orders for each SKU.
Community Champion

MEASURE AND REPORTMEASURE N TABULAR REPORT

Thanks & Regards,
Bhavesh

Love the Self Service BI.

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors