cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## Counting Rows basis of two columns

I have data like below

 Vendor code Duplicate basis of Bank account Duplicate basis of name Duplicate basis of Address Vendor A 1 1 1 Vendor B 1 1 0 Vendor C 1 0 0 Vendor D 0 0 1 Vendor E 1 0 1

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

 KPIs Count Percentage Count of duplicate vendor basis on Bank account 4 80% Count of duplicate vendor basis on name 2 40% Count of duplicate vendor Address 3 60%

Above table is just illustration of real table.

Can any one help????

1 ACCEPTED SOLUTION
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:

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

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:

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