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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Jagriti11
New Member

Counting Rows basis of two columns

I have data like below

 

Vendor codeDuplicate basis of Bank accountDuplicate basis of name Duplicate basis of Address
Vendor A111
Vendor B110
Vendor C100
Vendor D001
Vendor E101

 

I am trying to create table visual as below but I am stuck for the vendor where more than one condition is true.

 

KPIsCountPercentage
Count of duplicate vendor basis on Bank account 480%
Count of duplicate vendor basis on name 240%
Count of duplicate vendor Address 360%

 

Above table is just illustration of real table.

 

Can any one help????

1 ACCEPTED SOLUTION
jaideepnema
Solution Sage
Solution Sage

Hi @Jagriti11 ,
Unpivot the columns excluding the vendor code and then create two measures for Percentage and Vendor Count  as shown below:

Vendor Count = CALCULATE(DISTINCTCOUNTNOBLANK(Data[Vendor code]),Data[Count]=1)
Percentage % = DIVIDE([Vendor Count],CALCULATE([Vendor Count],ALL(Data[Flag])),BLANK())

This will give you desired result:

jaideepnema_0-1613117330276.png

 

 

Please accept this as a solution if you question has been answered
Appreciate a Kudos 😀
 

View solution in original post

1 REPLY 1
jaideepnema
Solution Sage
Solution Sage

Hi @Jagriti11 ,
Unpivot the columns excluding the vendor code and then create two measures for Percentage and Vendor Count  as shown below:

Vendor Count = CALCULATE(DISTINCTCOUNTNOBLANK(Data[Vendor code]),Data[Count]=1)
Percentage % = DIVIDE([Vendor Count],CALCULATE([Vendor Count],ALL(Data[Flag])),BLANK())

This will give you desired result:

jaideepnema_0-1613117330276.png

 

 

Please accept this as a solution if you question has been answered
Appreciate a Kudos 😀
 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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