Forum Discussion
Min / Max Price
- 1 year ago
Hi rod_puente ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you Ashish_Excel Nasif_Azam ajaybabuinturi for the prompt response.
I have created pbix file by using sample data, please go through attached pbix for your reference.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Hey rod_puente ,
Thanks for sharing the screenshot. From your table, the minimum and maximum prices of the painting are already included in the Min and Max columns. But just to confirm the actual computed values from the "Precio Unitario" (Unit Price) column:
Calculated Results from Data
Minimum Price: 434.00
Maximum Price: 685.00
If you're calculating this in Excel, you can use:
=MIN(D2:D14) =MAX(D2:D14)
Or in DAX:
Min Price = CALCULATE(MIN('Sales'[Precio Unitario]), ALLEXCEPT(Sales, Sales[Cod Producto]))
Max Price = CALCULATE(MAX('Sales'[Precio Unitario]), ALLEXCEPT(Sales, Sales[Cod Producto]))These formulas calculate:
The minimum or maximum price (Precio Unitario)
For each distinct Cod Producto
While ignoring all other filters in the report except Sales[Cod Producto]
When to Use These
You want to display Min/Max prices by product (e.g., in a matrix or card visual filtered by product)
You want consistent Min/Max values across visuals or rows for each product, even if other filters like Fecha or Folio are applied
You're not aggregating at the row level, but instead calculating grouped summary values
When Not to Use It
You're already aggregating by Cod Producto in your visual (DAX engine already scopes it correctly)
You don’t want to ignore slicers/filters outside of product
If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.
Best Regards,
Nasif Azam
- rod_puente1 year agoHelper I
Dear Nasif
Thanks for your solution, but I'd like the formula to allow me to apply time segments, for example, year, month, week, and other filters. When applying the filters, it's ideal for the MIN and MAX values to move within those segment dimensions.
The solution you propose takes the MIN and MAX of the entire database, without considering time segments, such as year and month.
What would the final formula look like?
Regards
Rodrigo Puente