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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ALEX13
Helper I
Helper I

Count occurences with several conditions

Hi, 

I have the following challenge for Power BI:

 

I want to count the number of "Orders" with a Result different to "Realizado", but with the following conditions:

 

  • If an "IC Client" has one "Order" with a result equal to "Realizado", it shouldn´t be considered into the count.
  • if an "IC Client" has more than 3 "Orders" with a result different to "Realizado" it shouldn´t be considered into the count.

For example:

OrderIC ClientCUPFecha inicio extremaResult
1383384210000028ES0234150015711/02/2018 0:00Imposible realizar
1386439610000028ES0234150015727/02/2018 0:00Innecesario
     
1375922410000030ES0234150022316/01/2018 0:00Imposible realizar
1372734910000072ES023411gg0TJ29/12/2017 0:00Imposible realizar
1372734510000072ES023411gg0TJ30/12/2017 0:00Imposible realizar
1372812010000072ES023411gg0TJ03/01/2018 0:00Imposible realizar
1373379410000072ES023411gg0TJ05/01/2018 0:00Imposible realizar
1372208910000125ES023415257DF28/12/2017 0:00Imposible realizar
1387818410000125ES023415257DF01/03/2018 0:00Realizado

 

For this example, the count of "Orders" with the conditions would be equal to 3 ("IC client"= 10000028 with "Order"=13833842 and 13864396;"IC client"=10000030 with "Order"=13759224).

 

Thank you very much in advance.

 

 

1 ACCEPTED SOLUTION

Also right. Fixed.

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@ALEX13

 

But this IC Client  1000002806 has third row equal to Realizado

 

Why is it considered while 10000125 is ignored?

  

Hi 

Hi @ALEX13

 

 

Why is this client ignored??

 10000030

Also right. Fixed.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.