Forum Discussion

shakirkhanani's avatar
8 years ago
Solved

Highest Basket (Receipt) Value

Hello, 

 

I need help in trying to find the highest / Max "Receipt No." baesd on the "Amount" as per the below Data Table: 

 

Receipt No.Goods CodeTimePriceQtyAmount
20180323000114100002782018-03-23 12:39:55249.001.00249.00
20180323000110130001942018-03-23 12:39:55369.001.00369.00
20180323000110130001952018-03-23 12:39:55369.001.00369.00
20180323000116110017882018-03-23 12:39:55749.001.00749.00
20180323000214100002782018-03-23 12:42:44249.001.00249.00
20180323000210130001942018-03-23 12:42:44369.001.00369.00

 

Thanks in advance.

  • Hi shakirkhanani

     

    Try this MEASURE

     

    Measure =
    VAR MaxAmount =
        MAXX (
            ALLSELECTED ( Table1[Receipt No.] ),
            CALCULATE ( SUM ( Table1[Amount] ) )
        )
    RETURN
        CALCULATE (
            FIRSTNONBLANK ( Table1[Receipt No.], 1 ),
            FILTER (
                ALLSELECTED ( Table1[Receipt No.] ),
                CALCULATE ( SUM ( Table1[Amount] ) ) = MaxAmount
            )
        )
    
  • Hi shakirkhanani

     

    Its there in the variable of the above MEASURE

     

    MaxAmount =
    MAXX (
        ALLSELECTED ( Table1[Receipt No.] ),
        CALCULATE ( SUM ( Table1[Amount] ) )
    )
    

     

     

7 Replies

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

    Hi shakirkhanani

     

    Try this MEASURE

     

    Measure =
    VAR MaxAmount =
        MAXX (
            ALLSELECTED ( Table1[Receipt No.] ),
            CALCULATE ( SUM ( Table1[Amount] ) )
        )
    RETURN
        CALCULATE (
            FIRSTNONBLANK ( Table1[Receipt No.], 1 ),
            FILTER (
                ALLSELECTED ( Table1[Receipt No.] ),
                CALCULATE ( SUM ( Table1[Amount] ) ) = MaxAmount
            )
        )
    
    • shakirkhanani's avatar
      shakirkhanani
      Icon for Helper I rankHelper I

      Brilliant! How can I further expand to show the Total Amount of the Measured Receipt No. 

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

        Hi shakirkhanani

         

        Its there in the variable of the above MEASURE

         

        MaxAmount =
        MAXX (
            ALLSELECTED ( Table1[Receipt No.] ),
            CALCULATE ( SUM ( Table1[Amount] ) )
        )