cancel
Showing results for
Did you mean:
Helper IV

## Issue with if in DAX

Hello all,
I have one question/Issue with DAX in statement IF

I try to make a flag, but if i used < my data is empty ... I don't know why...

Check my print screen

7 REPLIES 7
Super User

Try this:

AmountPrime=
Var _A = 120%
return
if([Med%]<_A,"Yes","False")

If it does not work, can you share a [Med%] measure code here?

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Helper IV

not ...

Med% =
VAR __BASELINE_VALUE = SUM('V_FACT_TMA_EOY_REFERENCE'[MED_ALL])
VAR __VALUE_TO_COMPARE = [Currents ALL]
RETURN
IF(
NOT ISBLANK(__VALUE_TO_COMPARE),
DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
+1)
Helper I

Hey,

the IF-Function is defined like this: IF(<logical_test>, <value_if_true>, <value_if_false>)

If I see it correctly, you missed the "else" statement.

Regards

Helper IV

@maxigtsh it's same ...

Helper I

hmmm... but if you don't inserte the measure there is data displayed?

What does the [Med%] measure do?

Helper IV

Med% =
VAR __BASELINE_VALUE = SUM('V_FACT_TMA_EOY_REFERENCE'[MED_ALL])
VAR __VALUE_TO_COMPARE = [Currents ALL]
RETURN
IF(
NOT ISBLANK(__VALUE_TO_COMPARE),
DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
+1)
Helper I

Last guess...

if( Ref <> blank() && Curr <> blank() && ([Med%]<1.2), "yes", "no")

Because I don't understand why there is no data displayed ;D

Regards

Announcements

#### The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

#### Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

#### Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!