Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
shakirkhanani
Helper I
Helper I

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.

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community 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
        )
    )

View solution in original post

Hi @shakirkhanani

 

Its there in the variable of the above MEASURE

 

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

 

 

View solution in original post

7 REPLIES 7
Zubair_Muhammad
Community Champion
Community 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
        )
    )

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

Hi @shakirkhanani

 

Its there in the variable of the above MEASURE

 

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

 

 

Genius, at least to me.  I wasted the half of my Sunday figuring this out.  Thanks again dear Zohaib.  Appreicate if you could share some pointers to me to improve by BI.

Thank you so much Zohaib for the tips and the books, will definitely check them out.  

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.