Forum Discussion

sabizen's avatar
sabizen
Helper I
1 year ago
Solved

Value Associated With Min Value From Another Column

hello everyone,
I would like to display in a table the value associated with the Min value of an additional table created on the fly. I tried to solve it by step. In  STEP 1 I correctly generated the measure to calculate the Min 

 
Measure 1 =
    var tab    =    SUMMARIZE(a_Master,a_Master[Data_rif],a_Master[ABI],a_Master[Bucket],"valore",[bpv IR01])
    var imp   =   MINX(tabella,[valore])
    return   imp
 
If i implement Measure 1 it correctly works.
Now, how to display instead the value "imp", the associated value in the column "a_Master[Bucket]" ?
 
thanks in advance
Sabi
 
 
 
  • I think you can use

    Bucket Measure =
    VAR SummaryTable =
        SUMMARIZE ( a_Master, a_Master[Data_rif], a_Master[ABI], a_Master[Bucket] )
    VAR Result =
        SELECTCOLUMNS ( TOPN ( 1, SummaryTable, [bpv IR01], ASC ), a_Master[Bucket] )
    RETURN
        Result
    
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi sabizen ,

     

    Please try this:

    Measure1 =
    VAR tab =
        SUMMARIZE (
            a_Master,
            a_Master[Data_rif],
            a_Master[ABI],
            a_Master[Bucket],
            "valore", [bpv IR01]
        )
    VAR imp =
        MINX ( tab, [valore] )
    VAR bucket =
        CONCATENATEX ( FILTER ( tab, [valore] = imp ), 'a_Master'[Bucket], "," )
    RETURN
        bucket

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

4 Replies

  • I think you can use

    Bucket Measure =
    VAR SummaryTable =
        SUMMARIZE ( a_Master, a_Master[Data_rif], a_Master[ABI], a_Master[Bucket] )
    VAR Result =
        SELECTCOLUMNS ( TOPN ( 1, SummaryTable, [bpv IR01], ASC ), a_Master[Bucket] )
    RETURN
        Result
    
    • sabizen's avatar
      sabizen
      Helper I

      this works as well!!! thank you so much

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi sabizen ,

     

    Please try this:

    Measure1 =
    VAR tab =
        SUMMARIZE (
            a_Master,
            a_Master[Data_rif],
            a_Master[ABI],
            a_Master[Bucket],
            "valore", [bpv IR01]
        )
    VAR imp =
        MINX ( tab, [valore] )
    VAR bucket =
        CONCATENATEX ( FILTER ( tab, [valore] = imp ), 'a_Master'[Bucket], "," )
    RETURN
        bucket

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

    • sabizen's avatar
      sabizen
      Helper I

      You're just a genius! Thank you so much