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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
daedah
Helper II
Helper II

calculate measure repeat maintenance

Hi

I trying calculate measure of repeat maintenace within same month of each machine_name  repaired in the same reason

Example data of  2019

Table : Maintenance 

Machine_Name               Reason                    Date          

A                                      person                     1/11/2019

B                                      spare parts               3/11/2019

C                                      Using                        4/11/2019
B                                      spare parts               15/11/2019
A                                      person                      1/12/2019

Result Of November
A                                    1

B                                    2   

C                                    1

 

Thank you for your help 🙏

1 ACCEPTED SOLUTION

@daedah ,

 

You can create a measure using dax as below:

Number of job_id per month per plate_id per reason = CALCULATE(DISTINCTCOUNT(repeat[job_id]), ALLEXCEPT(repeat, repeat[job date].[Month], repeat[plate_id], repeat[Reason]))

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yuta-msft
Community Support
Community Support

@daedah ,

 

Create a measure using dax as below:

Result of November = CALCULATE(COUNTROWS('Table'), FILTER(ALLEXCEPT('Table', 'Table'[Machine_Name]), MONTH('Table'[Date]) = 11))

Capture.PNG  

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much , If I want to add conditions with a maintenance within 30 days for the same reason & Machine_name

 

How should I do?

 

 

example data

https://drive.google.com/file/d/1jejj1gxsyfmACsVSqqG7d-9JEbidFxNI/view?usp=sharing 

 

Requirement is  The number of job_id  for each Machine_name it repair  within 30 days from job_date  for the same reason.


Report result
1576738394033.jpg

 

🙏 🙏

@daedah ,

 

You can create a measure using dax as below:

Number of job_id per month per plate_id per reason = CALCULATE(DISTINCTCOUNT(repeat[job_id]), ALLEXCEPT(repeat, repeat[job date].[Month], repeat[plate_id], repeat[Reason]))

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.