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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
daedah
Helper II
Helper II

repeat maintenance

Hi

I tring to calculate DAX measure for power bi ,calculate repeat maintenance by machine_name and Reason in month

Example data

Date                                Machine_name                             Reason
1/11/2019                        A                                                  Person

2/11/2019                        B                                                   spare part

3/11/2019                        A                                                   Person

10/11/2019                      C                                                    Using

12/11/2019                      B                                                    spare part

1/12/2019                        A                                                    person

 

Result of November 
Machine_Name       count of maintenance by month

A                                2

B                                2

C                               1

 

Thank you for your help 🙏

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@daedah it should be a simple measure and then whatever slicer you use the count will change, in this case you will on Nov, 2019 and the measure for count is:

 

Maintenance Count = COUNTROWS ( YourTable )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

@daedah 

 

Simply drag the fields and measure above to a Table visual. A measure always operates on aggregations of data under the evaluation context.

 

Community Support Team _ Sam Zha
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

6 REPLIES 6
parry2k
Super User
Super User

@daedah it should be a simple measure and then whatever slicer you use the count will change, in this case you will on Nov, 2019 and the measure for count is:

 

Maintenance Count = COUNTROWS ( YourTable )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you for you help 🙏    but I want  to count in condition same reason and same machine_name when I select slicer (Year , Month)

@daedah yes it will work, if I'm missing something, please explain further in detail.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Example data

Date                                Machine_name                             Reason
1/11/2019                        A                                                  Person

2/11/2019                        B                                                   spare part

3/11/2019                        A                                                   Person

10/11/2019                      C                                                    Using

12/11/2019                      B                                                    spare part

1/12/2019                        A                                                    person

 

Result of November 
Machine_Name       count of maintenance by month

A                                2  (2 from   ----- > 1)  1/11/2019 - Person   2) 3/11/2019 - Person  )

B                                2  (2 from   ------> 1) 2/11/2019 - spare part  2) 12/11/2019 - spare part

C                               1   (1 from  -------> 1) 10/11/2019 - Using

@daedah 

 

Simply drag the fields and measure above to a Table visual. A measure always operates on aggregations of data under the evaluation context.

 

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

@daedah ok so what is the problem the measure i gave to you, it woudl work, that's the thing I don't know. Did you tried it? If yes, what is not working?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors