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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
        )
    )

Regards
Zubair

Please try my custom visuals

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] ) )
)

 

 


Regards
Zubair

Please try my custom visuals

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
        )
    )

Regards
Zubair

Please try my custom visuals

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] ) )
)

 

 


Regards
Zubair

Please try my custom visuals

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.

@shakirkhanani

 

Also subscribe to following Power BI blogs and sites... and follow the posts/articles published there

 

www.powerpivotpro.com by @avisingh and Rob Collie

www.daxpatterns.com  by @AlbertoFerrari and @marcorusso

www.sqlbi.com by abovegentlmen

https://exceleratorbi.com.au/exceleratorblog/ by @MattAllington

https://www.excelguru.ca/blog/ by @KenPuls

http://www.ashishmathur.com/knowledge-base/ by @Ashish_Mathur


Regards
Zubair

Please try my custom visuals

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.