Forum Discussion

Priya_K's avatar
Priya_K
Regular Visitor
8 years ago
Solved

How to write between function in power bi

I am new to Power BI. I am trying to create a calculated field using between or if functions.   If the number in Column A is between 17 & 25 I want the result to be displayed as Critical & Improve ...
  • edhans's avatar
    edhans
    8 years ago

    Priya_K wrote:

    It worked when I use "&" instead of "and" in my formula in power query.

    IF(
    ('Work Items - All history by month'[Inherent Risk Score]>17) &&
    ('Work Items - All history by month'[Inherent Risk Score]<25),
    "critical",


    That is DAX. DAX uses a function similar to Excel - IF(condition, true, false) and as I noted above, you should use &&.

     

    Power Query uses this - and it is case sensitive.

    if condition then true else false

    And if you have multiple conditions, then it is

    if condition and condition and condition then true else false