Forum Discussion

R554's avatar
R554
Frequent Visitor
8 years ago

Countif with conditon

Hi Everyone,

 

I am quite new to Power BI. I have a scenario as below-

 

I have table (Customer Table), based on the count of column against each customer from the table i have given scores .

 

Ex: Customer 1 has 2 errors or appeared twice in the table then based on the count of number of errors i have to give scores.

 

Errors Points

1 20

2 10

3 and more 0

 

 

How can we achieve this task.

 

Thanks in advance!

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    You could use IF or SWITCH to achieve this.

     

    Basically, IF([Count]<2,20,IF([Count]<3,10,0))

    • R554's avatar
      R554
      Frequent Visitor

      Hi Greg,

       

      Sorry if i was not clear in the first post. I would need the output something as below-

       

      Name                 Errors              Points

      Customer 1           1                      10

      Customer 2           3                       0

       

      I have to present this table under Visualization. Also, to add to the above i have some other metrics from different tables where i have to apply if conditions based on the customer and the metric count for each customer and get the scores

       

      You can think this like a various tables with unique Customers list in one table and all i have to do is get each metric (count) from different tables to one table and present it as graph/table...

      • Anonymous's avatar
        Anonymous
        Not applicable

        R554 wrote:

         

        You can think this like a various tables with unique Customers list in one table and all i have to do is get each metric (count) from different tables to one table and present it as graph/table...


        R554,

        Do you also need to calculate error counts for each customer based on different tables? If so, please  share dummy data of these tables and post relationships among them.

        Regards,
        Lydia