MINX
A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
In this article, we will discuss everything you need to know about the MINX function in Power BI, its syntax and usage, and some examples to illustrate its application.
Syntax of MINX Function
The syntax of the MINX function in Power BI is as follows:
MINX(table, expression)
Where:
- **table** is a reference to a table or a table expression that contains the values to be evaluated by the expression.
- **expression** is a scalar expression to be evaluated for each row of the table.
Usage of MINX Function
The MINX function in Power BI evaluates a specified expression over a table and returns the minimum value. The expression can be a column name, a formula, or a combination of both. The MINX function iterates through the rows of a table and evaluates the expression for each row, returning the minimum value at the end of the iteration.
The MINX function is commonly used in scenarios where a user wants to find the minimum value of a specific column or a set of columns based on certain criteria. For example, a user may want to find the minimum sales value for each region and display the results in a table or a chart.
Examples of MINX Function
Let's take a look at some examples to understand the usage of the MINX function in Power BI.
Example 1: Finding the Minimum Value of a Column
Suppose we have a table named Sales with the following data:
| Product | Sales |
|---------|-------|
| A | 100 |
| B | 200 |
| C | 150 |
| D | 300 |
To find the minimum value of the Sales column, we can use the MINX function as follows:
Minimum Sales = MINX(Sales, Sales[Sales])
Here, we have passed the Sales table as the first argument and the Sales[Sales] column as the second argument. The MINX function evaluates the Sales[Sales] column for each row of the Sales table and returns the minimum value, which is 100.
Example 2: Finding the Minimum Value of a Column Based on a Condition
Suppose we have a table named Sales with the following data:
| Product | Region | Sales |
|---------|--------|-------|
| A | North | 100 |
| B | North | 200 |
| C | South | 150 |
| D | South | 300 |
To find the minimum sales value for each region, we can use the MINX function as follows:
Minimum Sales by Region =
MINX(
FILTER(Sales, Sales[Region] = “North”),
Sales[Sales]
)
Here, we have used the FILTER function to filter the Sales table by the Region column, where the Region is North. The MINX function evaluates the Sales[Sales] column for each row of the filtered table and returns the minimum value, which is 100 for the North region.
Similarly, we can find the minimum sales value for the South region by changing the filter condition to "South".
The MINX function in Power BI is a powerful tool that allows users to find the minimum value of a specified expression evaluated over a table. By following the syntax and usage guidelines discussed in this article, users can leverage this function to create complex calculations and expressions in their reports and dashboards.