Forum Discussion

CMoppet's avatar
CMoppet
Icon for Helper IV rankHelper IV
2 years ago
Solved

Unable to Relate Tables in the Right Way

I have two tables that I'm struggling to relate in the right way.   In one table (BaseSummary), I have a column that successully counts rows of 'soft faults' from the other table (WO Raw Data), as ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi CMoppet 

     

    Here I recommend that you do not create calculated columns.

     

    Because the calculations are listed as static calculations, you may not be able to change the results dynamically when using the slicer. You might consider creating measures.

     

    For your question, here is the method I provided:

     

    Here's some dummy data

     

    "WO Raw Data"

     

    "BaseSummary"

     

    "Operational"

     

    Create measures.

     

    No. of Soft Repairs = 
    var _Type = SELECTEDVALUE('BaseSummary'[MonthYearMachineType])
    RETURN
    COUNTROWS(
        FILTER(
            'WO Raw Data',
            'WO Raw Data'[MonthYearMachineType] = _Type
            &&
            'WO Raw Data'[HARDSOF] = "Soft"
            &&
            'WO Raw Data'[MTBF Repair?] = "Repair"
        )
    )

     

    No. of Hard Repairs = 
    var _Type = SELECTEDVALUE('BaseSummary'[MonthYearMachineType])
    RETURN
    COUNTROWS(
        FILTER(
            'WO Raw Data',
            'WO Raw Data'[MonthYearMachineType] = _Type
            &&
            'WO Raw Data'[HARDSOF] = "Hard"
            &&
            'WO Raw Data'[MTBF Repair?] = "Repair"
        )
    )

     

    No. of Repairs = 'BaseSummary'[No. of Hard Repairs] + 'BaseSummary'[No. of Soft Repairs]

     

    MTBF = DIVIDE(SELECTEDVALUE('Operational'[Weeks]), 'BaseSummary'[No. of Repairs])

     

    Here is the result.

     

     

     

     

    Regards,

    Nono Chen

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

     

     

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi CMoppet 

     

    If you are creating a measure, it is first recommended that you do not use EARLIER, which is used in the column. You need to use MAX in measure.

     

    If you still have questions, you can make a new post. You can share your data to get better help. Delete sensitive data.

     

    Regards,

    Nono Chen