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
Anonymous
Not applicable

Count from a specific data

Hi everyone,

I need help to solve my problem... 😞

 

I got one Table with my item list (id and name)

And I got one table with my datas about them :

id, intervention_date, intervention_label

2     03/02/2020         blabla

2     04/02/2020         maintenance1

3     06/02/2020         maintenance1

4     07/02/2020         blabla

2     10/02/2020         maintenance1

3      15/02/2020        maintenance2

...

 

And I would have this result :

item, nb maintenance1

1       5

2       3 (cause -> 5-2 "maintenance1")

3       5 (cause -> 5-0 "maintenance1" from the last "maintenance2")

4       5

 

I don't know if I'm clear...

Let me know!

 

Thanx for all!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

You can use a calculate like this:

CALCULATE(COUNT([FIELD]),[DATA_FIELD]>DATE(YEAR,MONTH,DAY),otherfilter)

 

Let me know if this is what you were looking for.

 

Best Regards,

DR

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

 

Anonymous
Not applicable

Hi @Anonymous ,

 

You can use a calculate like this:

CALCULATE(COUNT([FIELD]),[DATA_FIELD]>DATE(YEAR,MONTH,DAY),otherfilter)

 

Let me know if this is what you were looking for.

 

Best Regards,

DR

 

Anonymous
Not applicable

Thanx, sorry,

 

I used :

calculate(count('Fiches de maintenance'[Id]);'Fiches de maintenance'[Commentaires]="maintenance préventive 1";FILTER('Fiches de maintenance';'Fiches de maintenance'[Created]>calculate(max('Fiches de maintenance'[Created]);'Fiches de maintenance'[Commentaires]="maintenance préventive 2") && Outillages[Outillage]='Fiches de maintenance'[Piècedefectueuse]))
 
I always forget "FILTER()"

 

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.