Forum Discussion

daedah's avatar
daedah
Helper II
6 years ago
Solved

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 🙏

  • 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 )

     

  • daedah 

     

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

     

6 Replies

  • 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 )

     

    • daedah's avatar
      daedah
      Helper II

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

      • parry2k's avatar
        parry2k
        Super User

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