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

Get certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started

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
Super User
Super User

hi @Pieter_parker 

try to add a calculated column like:

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

View solution in original post

smpa01
Super User
Super User

@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
Super User
Super User

@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
Super User
Super User

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors