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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors