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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AniketPachaury
New Member

Trouble calculating minimum value by filtering other columns

I have columns for Machine Name, Shift (A, B, or C), and date.
I have a column called "value" which contains numbers.
I need to create a column measure which has the minimum value from the "values" column, for each machine, shift, and date.
I am facing trouble in doing so, since it always returns the value 0.
If I try to give it a small tolerance, it gives me a value just greater than the tolerance.
How can I solve this?

1 REPLY 1
Nathaniel_C
Community Champion
Community Champion

Hi @AniketPachaury ,
If I understand what you are asking, please try this:

Min value per shift per date = 

Var _date = Machine[Date]
Var _shift = Machine[Shift]

var _calc = CALCULATE(MIN(Machine[Values]), FILTER(ALL(Machine),Machine[Date]=_date && Machine[Shift]=_shift))

return _calc

You asked for a calculated column.

Nathaniel_C_0-1689441052865.png

 

Note that in my small sample there id only one instance where there are two rows with same date and shift and the minimum value is 6. 
 
If you would share your pbix, or dummy up some values in Excel both for current and expected data. Please copy and paste them into your post, rather than doing a picture, we may be able to help you. 

Please read this post to get your question answered more quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.