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
rphang
Frequent Visitor

Count Unique "Product Type" per Transaction

Hi everyone,

 

I am trying to find out the way to retrive unique counts of "Product Type" per transaction within my sales database.

 

My measure should return the results

-"2" counts for Transaction ID 100001

-"3" counts for Transaction ID 100002

-"1" counts for Transaction ID 100003

-"1" counts for Transaction ID 100004

 

Subsequently with the count calculated above, to display % vs total no. of transaction,

% of Transaction 
1 Type50%
2 Types25%
3 Types25%


My table structure is as such,

- Transaction Details that my POS system input

- Product database that stores Product Assortment

 

Table Name: Transaction Details

Transac IDStore ProductCost
100001Applexx.xx
100001Orangexx.xx
100001Bicyclexx.xx
100002Applexx.xx
100002Bicyclexx.xx
100002Colaxx.xx
100003Orangexx.xx
100003Applexx.xx
100003Pearxx.xx
100003Watermelonxx.xx
100004Orangexx.xx
100004Applexx.xx
100004Pearxx.xx
100004Watermelonxx.xx

 

Table Name: Products

Store ProductProduct Type
AppleFruits
OrangeFruits
BicycleItem
ColaDrinks
PearFruits
WatermelonFruits

 

--

Thank you

Ryan

2 REPLIES 2
Anonymous
Not applicable

 

If you slice by Transaction ID, this will give you the number of different product types per each transaction. If you have several transactions in scope, it'll tell you the same thing but in the context, that is, how many different product types there are in all the visible transactions.

// Products[Store Product] 1 -> * 'Transaction Details'[Store Product]

[Your Measure] =
COUNTROWS(
    SUMMARIZE(
        'Transaction Details',
        'Products'[Product Type]
    )
)

 

This is fantastic, with this measure it solves my first part.

 

Can I check what will be the measure to pull out seperately number of transaction with either count of 1, 2 or 3?

Cause with that I can do X-number of transaction / total transaction to get the % mix.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.