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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.