Forum Discussion

psorel's avatar
psorel
Helper I
2 years ago

Objectives / Production

 

Hello, I need to carry out a production comparison with the objectives. I have the 2 tables in joint. Problem, when I reread the "DAY" column to the "accompanying date" column, I only have 0.6 to count the days where there is an "accompanying date".
I would like to obtain in a table for the month of January (21 ( working days in january) x0.6 therefore 12.6) as objective and 1 achieved in the same table for worker A.

Do you have a solution? 

 

Thank's 

5 Replies

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

    Do not include sensitive information or anything not related to the issue or question.

    If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

    • psorel's avatar
      psorel
      Helper I

      Hi lbendlin 

      PBIX file and Xlsx/CSV are not supported so the first table with Productin of different workers in different teams.

      WORKERAccompanying DateDurationTEAM
      A01/01/20233BLUE
      A05/02/20234BLUE
      A06/05/20232BLUE
      A07/07/20230,5BLUE
      B01/01/20233BLUE
      B05/03/20234BLUE
      B06/05/20232BLUE
      B07/07/20230,5BLUE
      C01/01/20234GREEN
      C02/01/20234GREEN
      C03/05/20232GREEN
      C07/07/20230,5GREEN
      D01/01/20233GREEN
      D05/02/20234GREEN
      D06/05/20232GREEN
      D07/07/20230,5GREEN

      2nd Table with the objectivs with working days : 

      Date Objectiv Team1Objectiv Team2Working days Teams 1Working days Teams 2
      01/01/2023 0,60,8  
      02/01/20230,60,80,60,8
      03/01/20230,60,80,60,8
      04/01/2023 0,60,80,60,8
      05/01/2023 0,60,80,60,8
      06/01/2023 0,60,80,60,8
      07/01/2023 0,60,8  
      08/01/2023 0,60,8  
      09/01/2023 0,60,80,60,8
      10/01/2023 0,60,80,60,8
      11/01/2023 0,60,80,60,8
      12/01/2023 0,60,80,60,8
      13/01/2023 0,60,80,60,8
      14/01/2023 0,60,8  
      15/01/2023 0,60,8  
      16/01/2023 0,60,80,60,8
      17/01/2023 0,60,80,60,8
      18/01/2023 0,60,80,60,8
      19/01/2023 0,60,80,60,8
      20/01/2023 0,60,80,60,8
      21/01/2023 0,60,8  
      22/01/2023 0,60,8  
      23/01/2023 0,60,80,60,8
      24/01/2023 0,60,80,60,8
      25/01/2023 0,60,80,60,8
      26/01/2023 0,60,80,60,8
      27/01/2023 0,60,80,60,8
      28/01/2023 0,60,8  
      29/01/2023 0,60,8  
      30/01/2023 0,60,80,60,8
      31/01/2023 0,60,80,60,8
      01/02/2023 0,60,8  
      02/02/2023 0,60,8  
      03/02/2023 0,60,8  
      04/02/2023 0,60,8  
      05/02/2023 0,60,8  
      06/02/2023 0,60,8  
      07/02/2023 0,60,8  
      08/02/2023 0,60,8  
      09/02/2023 0,60,8  
      10/02/2023 0,60,8  
      12/02/2023 0,60,8  
      13/02/2023 0,60,8  

      I would like a table or matrix visual with all the years/months/week ( with and without production) with columns Objectivs and production of each teams/workers. I don't know if i can add hierarchy date at the same time in the visual. Maybe date filters are better.
      One more problem,  objectivs are not multiplicated by the number of workers on the periode. In january the objectiv is 13,80 * NB of workers

       

      Thanks

      • lbendlin's avatar
        lbendlin
        Super User

        Your Objectives table is not in a usable format.  The columns are grouped, the column names are inconsistent, and some values have leading spaces.  Here is the transform required to bring it into usable format:

         

         

        let
            Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jdRRCoUgFIThrVx8Fq7OKau1RPvfRtqLIhz8ocjgA3GG432HlP/1UZKFGH4plvpJ8Ww/3/vEajSYkfT1x4yxzdtxcjt0BboDnPQE5mL75QSd28DkBJ1B5/bQz5rdDgYD889u/pNzO5gc7EGwB4FJkNvBYGD+gnMgOAeCPQj2IDALcjvoxmD+Bueg3VgCN9bSGDAbMDswBZgDmBOYa23a3bQ0IMO8yvB5AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, #" Objectiv Team1" = _t, #"Objectiv Team2" = _t, #"Working days Teams 1" = _t, #"Working days Teams 2" = _t]),
            #"Renamed Columns" = Table.RenameColumns(Source,{{"Working days Teams 1", "Working days Team1"}, {"Working days Teams 2", "Working days Team2"}}),
            #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Date"}, "Attribute", "Value"),
            #"Trimmed Text" = Table.TransformColumns(#"Unpivoted Other Columns",{{"Attribute", Text.Trim, type text}}),
            #"Split Column by Character Transition" = Table.SplitColumn(#"Trimmed Text", "Attribute", Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"}), {"Attribute.1", "Team"}),
            #"Pivoted Column" = Table.Pivot(#"Split Column by Character Transition", List.Distinct(#"Split Column by Character Transition"[Attribute.1]), "Attribute.1", "Value"),
            #"Changed Type" = Table.TransformColumnTypes(#"Pivoted Column",{{"Date", type date}, {"Objectiv Team", type number}, {"Working days Team", type number}},"nl")
        in
            #"Changed Type"

         

         

        I don't understand where the duration value comes into play. Can you please elaborate?  How do you correlate teams 1 and 2 with teams BLUE and GREEN ?