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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

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

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors