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
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
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.