Forum Discussion

Jagriti11's avatar
Jagriti11
New Member
5 years ago
Solved

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????

  • 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 ğŸ˜€
     

1 Reply

  • 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 ğŸ˜€