Forum Discussion

Sravan_cheni's avatar
Sravan_cheni
New Member
4 years ago
Solved

Urgent!!!! I need quick help

As seen in the above image rows indicates Type and column indicates work station and the values are the total units processed in a workstation based on the uph type (shown in %).

 


Now i need to create a new table in Power BI desktop as above (Note : not a visual i need to create a new table data)
Now i have Type, Workstation, Units, Units% on workstation.

Example 1: i have to create a new column showing for work station augtobag the top units processed Type is Autobag so i need Autobag for the workstation Autobag, 

example 2 : i have to create a new column showing for work station Flexible queues the top units processed Type is Heat Seal so i need Heat seal  for the workstation Flexible queues, 

Result should come as below

Please help me i have tried different scenarios but unable to achieve.



 

truptisamitchandakjohnt75lbendlin,tamerj1Jihwan_KimAlexisOlson,PaulDBrownVijay_A_Verma,parry2k 

 

  • Hi Sravan_cheni 
    For the table you need to select the required columns from the original one and then add the measures as columns.

     

    Table2 =
    VAR SelectedTable =
        SELECTCOLUMNS (
            Table,
            "UPH_TYPE", Table[UPH_TYPE],
            "WORKSTATION (TIER 2)", Table[WORKSTATION (TIER 2)]
        )
    RETURN
        ADDCOLUMNS ( SelectedTable, "Units_S", [Units_S], "% units", [% units] )

     

    Then add a new calculated column

     

    New Column =
    VAR WSTable =
        CALCULATETABLE ( Table2, ALLEXCEPT ( Table2, Table2[WORKSTATION (TIER 2)] ) )
    VAR MaxUnits =
        MAXX ( WSTable, Table2[Units_S] )
    RETURN
        MAXX ( FILTER ( WSTable, Table2[Units_S] = MaxUnits ), Table2[UPH_TYPE] )

     

2 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Sravan_cheni 
    For the table you need to select the required columns from the original one and then add the measures as columns.

     

    Table2 =
    VAR SelectedTable =
        SELECTCOLUMNS (
            Table,
            "UPH_TYPE", Table[UPH_TYPE],
            "WORKSTATION (TIER 2)", Table[WORKSTATION (TIER 2)]
        )
    RETURN
        ADDCOLUMNS ( SelectedTable, "Units_S", [Units_S], "% units", [% units] )

     

    Then add a new calculated column

     

    New Column =
    VAR WSTable =
        CALCULATETABLE ( Table2, ALLEXCEPT ( Table2, Table2[WORKSTATION (TIER 2)] ) )
    VAR MaxUnits =
        MAXX ( WSTable, Table2[Units_S] )
    RETURN
        MAXX ( FILTER ( WSTable, Table2[Units_S] = MaxUnits ), Table2[UPH_TYPE] )