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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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