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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
R554
Frequent Visitor

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 6
Greg_Deckler
Super User
Super User

You could use IF or SWITCH to achieve this.

 

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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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


@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

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yuezhe-msft Please find the dummy data in the below mentioned link-

 

https://drive.google.com/file/d/1GzQ8qW1Fkp9TUZRy-Ffc-ffpBinBD3mG/view?usp=sharing

 

Relationships - I want to create a list of suppliers in a separate table (Unique Supplier List) and link this table with all the other tables as per attached file.

 

Relationship is supplier for all tables.

 

The catch here is the data tables have data broken down by month and my calcualtion should be number of errors made by a particular supplier for that specific month.

 

I want to create a visualization where end user have to select Month (Reporting Date in all tables) and list of suppliers with their Scores from different tables should populate.

 

 

 

 

@R554,

What logic do you  use to calculate errors for these suppliers? Please help to post expected result in table format based on your dummy data.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yuezhe-msft

 

Please find the below link for the logic

 

https://drive.google.com/open?id=1u8_F5y7zv8JqTfWzxplMaav7uZStdnVJ

 

Thanks

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.

June 2025 community update carousel

Fabric Community Update - June 2025

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