Forum Discussion

calerof's avatar
calerof
Icon for Impactful Individual rankImpactful Individual
5 years ago
Solved

Include several mesasures into one table

Hello,

I'm trying to perform the easiest process in Excel where you take several measures and put them together into one table like this:

The first Total in column P is a measure with this code:

 

NoTRSDerTotal = 
VAR MinXShift = [Sum MinLab] * [Count Num Days]
RETURN
DIVIDE(
    [Sum MinNoTRSDer],
    MinXShift
    )

 

where NoTRSDerTotal is the number of minutes the manufacturing machine was not operating divided by the total minutes per shift.

MinLab are the total working minutes per shift, or the working hours per shift * 60:

 

Sum MinLab = SUM(HorasxTurno[MinLaborables])

 

CountNumDays is the number of days where there were operations.

MinNoTRSDer are the number of minutes the manufacturing machine was not operating due to a failure, which are classified with the code NoTRSCode that can be AMOL, AP, CM, PO, PP.

 

Then, I have two additional measures:

1) TRSDer%

 

TRSDer% = 
DIVIDE(
    CapturaProduccion[TUDer],
    [Sum Horas Laborables] * [Count Num Days]
)

 

 

where TRSDer% is the coefficient of TUDer divided by the total hours per shift times the number of working days.

 

TUDer = 
SUMX(CapturaProduccion, DIVIDE( [Sum PzProdBuenasDer], CapturaProduccion[PzObjDer] ) )

 

 

2) NoCal

 

_NoCal%Der = 
DIVIDE(
    SUMX(CapturaProduccion, DIVIDE( [Sum PzScrapDer], CapturaProduccion[PzObjDer] ) ),
    [Sum Horas Laborables] * [Count Num Days]
)

 

where NoCalDer divides the total bad pieces by the target number of pieces per shift as numerator, and divides this by the total number of hours per shift times the number of working days.

 

What I need is to show all in one table to add them up and show as a visual in a chart.

Now I just have them sitting in two different tables in PBI:

measure1 NoTRSmeasure2 TRSmeasure3 NoCal

I know it looks a bit complicated but in excel is so easy. Here I'm really struggling to think on a solution.

Here is my pbix file.

I appreciate a lot any help on this.

Thanks,

Fernando

  • I'm closing this post and will check the data model and the fact table to improve it. Thank you for any help provided.

    Fernando

7 Replies

  • Hi calerof ,

     

    I would say it's easy in Power BI as well. 🙂

     

    So measures are never at a table/dataset level. They are at a data model level. You can access any measure from any table in other table.

     

    So basically, in TABLE1 you can create a measure that adds up all the measures coming from TABLE2 and from TABLE3.

     

    Hope this helps.

     

    Thanks,

    Pragati

    • calerof's avatar
      calerof
      Icon for Impactful Individual rankImpactful Individual

      Hi Pragati11 ,

      Thanks for your response. But I need the granularity, I need to show basically each column from the first table, i.e. NoTRS with each category: AMOL, AP, CM, etc, and TRS and NoCAL, and then the Grand Total. 

      F

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi calerof 

        I think you want to show two matrix visuals in one like Excel.

        You can build a new table (By merge)then pivote them or build five measures (AMOL, AP, CM, PO, PP and add these measures like NoTRSDerTotal, TRSDer% into values in matrix).

        You may refer to this post: How to Subtract Data From Same Column In Imported Table When Put In Matrix?

         

        Best Regards,

        Rico Zhou

         

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