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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
AllanArayita
New Member

Bring the Min value in a column

Hello Good People! 

 

Can you help to figure out how to create the Min Value in a column - taking the small value of a data?

 

Example: In Soccer Value: 2 - In Baseball Value:  (repeated in all rows the last Value)

SportValue
Socccer2
Socccer3
Socccer4
Socccer4
Baseball4
Baseball4
Baseball1
Baseball3
Baseball6
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AllanArayita ,

The Table data is shown below:

vzhouwenmsft_0-1720056699333.png

Please follow these steps:

1.Add an index column after grouping by column 'Sport' in Power query.

vzhouwenmsft_1-1720056871984.png

Table.AddIndexColumn([Count],"Index",1)

vzhouwenmsft_2-1720056964665.png

vzhouwenmsft_3-1720057053486.png

vzhouwenmsft_5-1720057145965.png

vzhouwenmsft_6-1720057168596.png

2.Use the following DAX expression to create a column

Column = 
SWITCH(TRUE(),
[Sport] = "Socccer", CALCULATE(MIN('Table'[Value]),ALLEXCEPT('Table','Table'[Sport])),
[Sport] = "Baseball",
    VAR _maxIndex = CALCULATE(MAX('Table'[Index]),ALLEXCEPT('Table','Table'[Sport]))
    RETURN CALCULATE(MAXX(FILTER('Table',[Index] = _maxIndex),[Value]),ALLEXCEPT('Table','Table'[Sport]))
)

3.Final output

vzhouwenmsft_7-1720058039825.png

 

Best Regards,
Wenbin Zhou
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

1 REPLY 1
Anonymous
Not applicable

Hi @AllanArayita ,

The Table data is shown below:

vzhouwenmsft_0-1720056699333.png

Please follow these steps:

1.Add an index column after grouping by column 'Sport' in Power query.

vzhouwenmsft_1-1720056871984.png

Table.AddIndexColumn([Count],"Index",1)

vzhouwenmsft_2-1720056964665.png

vzhouwenmsft_3-1720057053486.png

vzhouwenmsft_5-1720057145965.png

vzhouwenmsft_6-1720057168596.png

2.Use the following DAX expression to create a column

Column = 
SWITCH(TRUE(),
[Sport] = "Socccer", CALCULATE(MIN('Table'[Value]),ALLEXCEPT('Table','Table'[Sport])),
[Sport] = "Baseball",
    VAR _maxIndex = CALCULATE(MAX('Table'[Index]),ALLEXCEPT('Table','Table'[Sport]))
    RETURN CALCULATE(MAXX(FILTER('Table',[Index] = _maxIndex),[Value]),ALLEXCEPT('Table','Table'[Sport]))
)

3.Final output

vzhouwenmsft_7-1720058039825.png

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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