Forum Discussion
MatheusFraga
2 years agoNew 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: Thanks
- Anonymous2 years ago
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] ) + 0Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dangar332
Resident Rockstar
2 years agoHi, MatheusFraga
Is there any creiteria that define number less then x is lower numbe
MatheusFraga
2 years agoNew Member
Yes, the column Product. I need the lowest price for each Product, then rank the Suppliers
- Anonymous2 years agoNot 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] ) + 0Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.