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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
hozefamk
Advocate II
Advocate II

How to calculate minimum of a value from a group of similar values in other column ?

I have a field name material and Kitting quantity, here i have filtered for only one particular material type, there are hundreds of different material arranged randomly in row. I have another field kitting quantity where values are different for even same material quantity. I want to create a new row, which should calculate the minimum value of Kitting quantity out of all similar material and print the same correspondance to them in the new column.

solution.PNG

 

Field highlighted in Yellow are my given field and higlighted in blue is the desired output.

P.S: Material can be arranged randomly in any order so Filter(Table(field)=Earlier(Table(field)) is useless in this case and I am looking to solve in Power Query using Custom Colum.

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @hozefamk,

 

Please refer to below DAX formula to create a calculated column.

Min Column Quantity =
CALCULATE (
    MIN ( Table[Kitting quantity] ),
    ALLEXCEPT ( Table, Table[Material] )
)


Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @hozefamk,

 

Please refer to below DAX formula to create a calculated column.

Min Column Quantity =
CALCULATE (
    MIN ( Table[Kitting quantity] ),
    ALLEXCEPT ( Table, Table[Material] )
)


Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Turnipface
Advocate I
Advocate I

It worked in 2 ways in a small test that you can see here as .pbix


Option 1 was to display it as a table and measure the quantity as "Minimum"

image.png

 

Option 2 was to Add a new column with formula =  MIN(Kitting quantity)

 

Do any of these work for what you're trying to do?

 

 

As per your solution you get minimum value same for all rows. from your application i need minimum value to be 3 for wood and 4 for Stone. 

Fair point...i guess i should have checked before sending 🙂
It does seem to work as a Measure with the same formula, but not as a column. I can't seem to get it to work as a column.
Perhaps somebody else can help here.

Anonymous
Not applicable

Hi @hozefamk

 

What is source of this data? Is it SQL Server Database?

 

 

Thanks,

Suguna.

I am extracting data from Excel

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors