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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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


View solution in original post

1 REPLY 1

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


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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