Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Vanessa250919
Helper IV
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

 

Vanessa250919_0-1631819330069.png

 

7 REPLIES 7
VahidDM
Super User
Super User

@Vanessa250919 

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.

Appreciate your Kudos✌️!!



@VahidDM 

 

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)
Anonymous
Not applicable

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

@Anonymous it's same ...

Vanessa250919_0-1631822892836.png

 

Anonymous
Not applicable

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

What does the [Med%] measure do? 

 

 

@Anonymous 

 

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)
Anonymous
Not applicable

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.