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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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?

  

Regards
Zubair

Please try my custom visuals

Hi 

Hi @ALEX13

 

 

Why is this client ignored??

 10000030

Regards
Zubair

Please try my custom visuals

Also right. Fixed.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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