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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.