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
Anonymous
Not applicable

Counting number of rows of unique column A and B combination then divide by total number of unique A

Hi I believe I have a very difficult problem....

 

I have a table like this:

MonthDistributorSeller
Oct-19ABen
Oct-19BTom
Oct-19CMary
Oct-19DBen
Dec-19AMary
Dec-19BBen
Dec-19CJohn
Jan-20ABen
Jan-20BTom

 

I need to create a new column.

This column will count the number of unique Distributor and Seller combinations (ie A-Ben is different from B-Ben), THEN divide by the number of rows which contains the Seller.

 

For example, expected output is below:

MonthDistributorSellerNew column
Oct-19ABen0.50
Oct-19BTom1
Oct-19CMary0.5
Oct-19DBen0.25
Dec-19AMary0.5
Dec-19BBen0.5
Dec-19CJohn1
Jan-20ABen0.5
Jan-20BTom1

 

Explanation. First row.

In the whole table, there are 2 A-Ben combinations. In the whole Seller column, there are 4 rows which contain Bens. So the ratio in the new column would be 2/4 = 0.5.

 

Second row.

In whole table, there are 2 B-Tom combinations. In the Seller column, there are 2 rows which contains Tom. So ratio = 2/2 = 1.

 

Lastly... the ratio needs to be filtered by time!!!!
If this is too hard, please teach me how to do it WITHOUT time filter....

 

Thanks in advance

1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous 

 

check this out.

PBIX

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

1 REPLY 1
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous 

 

check this out.

PBIX

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors