Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Power BI: The lowest value between two columns

is there a possibility to find the lowest value between two columns in Power BI?

This is the table:

Name Maths Physics
Emma 73.2 32.5
Theo 95.3 76.5
Ellen 52.7 99.7

I have to get a card that would in this case show Emma because if we compare both exams, the worst result got Emma from Physics.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Preferably, the card would say Emma 32.5, but Emma is fine, too.

My research:

these two ways give a good result, but only for one column:

First:

MinResult = CALCULATE(MIN(results(Name),TOPN(1,'results',results[Maths],ASC))

Second:

MinResult = 
    CALCULATE(
        MIN(results(Name),
        results[Maths] = MIN(results[Maths])
    )

>Solution :

You were close. You can add an expression to the TOPN.

MinResult =
  CALCULATE(
    MIN(results[Name]),
    TOPN(1, 'results', MIN([Maths], [Physics]), ASC)
  )

And with score:

MinResult = 
  CALCULATE(
    MIN(results[Name]) & " " & MIN( MIN(results[Maths]), MIN(results[Physics]) ),
    TOPN(1, 'results', MIN([Maths], [Physics]), ASC)
  )

You may want to consider whether Unpivoting your table in PowerQuery would be more useful:

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading