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! Request now

Reply
MatheusFraga
New Member

How to count the smallest values

Good day, I need a measure that counts the number of lowest prices from each supplier, as in the table on the right:

 

b893183b-a008-42cf-9be3-6dea994fcfd3.png

 Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MatheusFraga ,

 

Please try code as below to create a measure.

Qt.Of best price =
VAR _SUMMARIZE =
    SUMMARIZE (
        FILTER (
            ADDCOLUMNS (
                'Table',
                "Lowest Price", CALCULATE ( MIN ( 'Table'[Price] ), ALLEXCEPT ( 'Table', 'Table'[Product] ) )
            ),
            [Price] = [Lowest Price]
        ),
        [Supplier],
        [Product],
        [Price]
    )
RETURN
    COUNTAX ( _SUMMARIZE, [Product] ) + 0

Result is as below.

vrzhoumsft_0-1698040839138.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Dangar332
Super User
Super User

Hi, @MatheusFraga 

Is there any creiteria that define number less then x is lower numbe 

Yes, the column Product. I need the lowest price for each Product, then rank the Suppliers

Anonymous
Not applicable

Hi @MatheusFraga ,

 

Please try code as below to create a measure.

Qt.Of best price =
VAR _SUMMARIZE =
    SUMMARIZE (
        FILTER (
            ADDCOLUMNS (
                'Table',
                "Lowest Price", CALCULATE ( MIN ( 'Table'[Price] ), ALLEXCEPT ( 'Table', 'Table'[Product] ) )
            ),
            [Price] = [Lowest Price]
        ),
        [Supplier],
        [Product],
        [Price]
    )
RETURN
    COUNTAX ( _SUMMARIZE, [Product] ) + 0

Result is as below.

vrzhoumsft_0-1698040839138.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.