Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
in Power BI by 16 16 22

I have a table in Power BI as below, and I need to calculate which record has the minimum value based on the if condition.

Country People count
France 20
USA 15
England 30

In the above table, if the value matches with the min value it displays the true value in a new column else it displays the false value.

The expected output should be like this table, If the country has the lowest value show true otherwise show false

Country People Count Rate
France 20 false
USA 15 true
England 30 false

How can I use the IF condition with MIN() DAX function in Power BI?

1 Answer

1 like 0 dislike
by 155 174 350
selected by
Best answer

First, you should be aware that there is no IF MIN() function in Dax, Instead, you can quickly get the smallest value based on a condition using the below formula:

MINIF = IF('Employee Degree'[Degree] = min('Employee Degree'[Degree]),"Lowest","Not Lowest")


Power BI IF MIN DAX function based on IF condition

Another way to get the Minimum value with IF condition is to define a variable as shown below:

 VAR LowDegree = MIN('Employee Degree'[Degree])
IF('Employee Degree'[Degree] = LowDegree,"Lowest","Not Lowest")



Check also many of Power BI DAX samples at https://github.com/melqassas/PowerBI

If you don’t ask, the answer is always NO!