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 product table in Power BI that has two columns for the current month's discount and the previous month's discount as below, and I need to know which month has the smallest discount in two columns, how can I do that in Power BI and show the minimum value in two columns in a card?

Product Jan Discount Feb Discount
Product 1 50 20
Product 2 30 10

1 Answer

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

How to get the minimum value in two columns in Power BI?

To get the lowest value in two columns in Power BI, you can use the MINX DAX function below

Lowest discount = MINX(Products,MIN(Products[Jan Discount],MIN(Products[Feb Discount])))

Min value between two columns in Power BI

In the above example, the MINX DAX function returns the smallest value that results from evaluating an expression for each row of a table.

MINX DAX Considerations

  • The MINX function takes as its first argument a table or an expression that returns a table.
  • The second argument contains the expression that is evaluated for each row of the table.
  • Blank values are skipped.
  • TRUE/FALSE values are not supported.
  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Check also Power BI Samples

by 16 16 22
0 0
Thanks Mohamed, It's working!
If you don’t ask, the answer is always NO!