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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Pieter_parker
Frequent Visitor

DAX calculations, min value out of two columns.

Hello everyone,

 

I'm trying to do some dynamic, row-wise calculations in Power BI. 

1. I would like the measure to take a lower value out of two columns - "Period 1" and "Period 2". 

So basically, I would like to have the following View in my table - "min value" is the desired output. 

Pieter_parker_0-1675767527395.png

I was trying to achieve it with minx function, to calculate everything per row, for example:

- Minx(Table, [Period 1] & [period 2]) - but the returned result is not correct. 

 

Thanks in advance for any help. 

2 ACCEPTED SOLUTIONS
FreemanZ
Community Champion
Community Champion

hi @Pieter_parker 

try to add a calculated column like:

Min value = MIN([Period 1], [Period 2])

View solution in original post

smpa01
Community Champion
Community Champion

@Pieter_parker  with MINX as calulated column

Column = 
MINX ( { { t1[p1] }, { t1[p2] } }, [Value] )

 

smpa01_0-1675791160327.png

 

with MINX as measure

Measure 2 = MINX ( { { MIN(t1[p1]) }, { MIN(t1[p2]) } }, [Value] )

 

smpa01_1-1675791198261.png

 

with MIN as measure

Measure = min(MIN(t1[p1]),MIN(t1[p2]))

smpa01_2-1675791218121.png

 

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

5 REPLIES 5
smpa01
Community Champion
Community Champion

@Pieter_parker  with MINX as calulated column

Column = 
MINX ( { { t1[p1] }, { t1[p2] } }, [Value] )

 

smpa01_0-1675791160327.png

 

with MINX as measure

Measure 2 = MINX ( { { MIN(t1[p1]) }, { MIN(t1[p2]) } }, [Value] )

 

smpa01_1-1675791198261.png

 

with MIN as measure

Measure = min(MIN(t1[p1]),MIN(t1[p2]))

smpa01_2-1675791218121.png

 

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Hi @smpa01 -
Thank you for your answer. I have a similar issue and used the measure (measure 2) and got the right values. However I do get wrong row totals. Just like in your screenshot as you have 100 and ideally it should be 400. How can I fix this?

Maybe @FreemanZ could also help here 🙂

@askpbiuser  Sorry, could not reply earlier. You can do any of the following

 

smpa01_0-1701876280081.png

 

smpa01_1-1701876593108.png

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
FreemanZ
Community Champion
Community Champion

hi @Pieter_parker 

try to add a calculated column like:

Min value = MIN([Period 1], [Period 2])

This is what I needed, thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.