Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

need one maximum value of multiple maximum

i have a table that have Date & line wise values . now i need only one maximum value but but it showing all maximum value in a day in a line . plz help me

10 Replies

  • Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Please show the expected outcome.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello Dear Brothers
    I have a table that contains the date, Line & model wise manpower. I use the manpower in the various model in the various line. My data set is line-wise in a day. I need only one line's Manpower value & rest of the line of the value will be 0. How can i do that?
    Plz help me.

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      Power BI has no concept of "line wise" or "row number". It is your responsibility to provide a guaranteed sort order or (better) an index column.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Bro. im getting Maximum value of same manpower in very row which is incorrect sum value of the manpower. i need only one value of the manpower in a date in same line/Row of same citeria(line&model).

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      Look into the "Remove Duplicates" transform in Power Query. You can specify which columns to include in the decision.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Remove Duplicates is not the solution bro!

    same number value can be in other row/line

     

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. 

  • v-xiaotang's avatar
    v-xiaotang
    Icon for Community Support rankCommunity Support

    Hi Anonymous 

    Try this,

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dc+xCoAgEIDhVwnnQO80wbGGQDAaaosGB8eWqPdPqUAuGxSHj/P+ZWF98Me5B1YzGQ9wNBwFYnx32sRbNWytcwaUOUCRIBKIH2h0cpI4RZxTujSOsk5jid0VUpAK+ilQ5qonA4oZuTTZftPm96Og2nkcKmv/Q/IN35D1Ag==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Seg = _t, Line = _t, Date = _t, Model = _t, Manpower = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Seg", type text}, {"Line", Int64.Type}, {"Date", type date}, {"Model", type text}, {"Manpower", Int64.Type}}),
        #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
        #"Reordered Columns" = Table.ReorderColumns(#"Added Index",{"Seg", "Index", "Line", "Date", "Model", "Manpower"}),
        #"Grouped Rows" = Table.Group(#"Reordered Columns", {"Line", "Date", "Manpower"}, {{"test1", each List.Min([Index]), type number}, {"test2", each _, type table [Seg=nullable text, Index=number, Line=nullable number, Date=nullable date, Model=nullable text, Manpower=nullable number]}}),
        #"Expanded test2" = Table.ExpandTableColumn(#"Grouped Rows", "test2", {"Seg", "Index", "Model"}, {"Seg", "Index", "Model"}),
        #"Added Custom" = Table.AddColumn(#"Expanded test2", "Custom", each if [Index]=[test1] then [Manpower] else null),
        #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"test1", "Index"})
    in
        #"Removed Columns"

     

    Best Regards,

    Community Support Team _Tang

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank Dear

    After Trying i will late you know by tomorrow

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for your kind support. Till now problem not yet solved . if intial value is minimum then it taking the value but i need maximum value. im sharing my data model for your again