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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Get the max for a calculated measure based on top 10 products

Hello,

 

I have a measure that ranks my products based on sales 

Product Rank =
VAR Ranking =
    RANKX(
        FILTER(
            ALLSELECTED(Product[Product]),
            NOT(ISBLANK(CALCULATE(SUM(Sales[Quantity]))))
        ),
        CALCULATE(SUM(Sales[Quantity]))
    )
RETURN
    Ranking
 
Another measure that gets the maximum of a calculated measure 
MAXX(Sales, [Declared Stock]) however this measure gets the maximum value of declared in the whole dataset.
 
I would like to get the maximum but only within the top 10 products, how can I achieve that?
 
Thank you!
1 REPLY 1
Mahesh0016
Super User
Super User

@Anonymous i hope this helps you !THANK YOU!!
Plot this measure  MAXX(Sales[Declared Stock])

Mahesh0016_0-1687527207566.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.