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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
vjnvinod
Impactful Individual
Impactful Individual

Error using if condition

hi,

 

i am getting the below error, can you help me?

 

Capture.PNG

6 REPLIES 6
ryan_mayu
Super User
Super User

@vjnvinod 

if(condition1&&condition2), you need to remove the if I highlighted in the below screenshot.

 

1.PNG

 

If you want to sort in order, you create a new table, column 1 order :1,2,3; column two values(like(>$25M). Create relationship with the fact table and order table.

Or you can add the order number in the formula. "1. >$25M"





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




v-yingjl
Community Support
Community Support

Hi @vjnvinod ,

The ‘&&’ operator should not be used between two if() statements, just modify like this:

Column = 
IF(
    'Procurementdata'[Transaction Amount] >= 25000000,
    ">$25M",
    IF(
        'Procurementdata'[Transaction Amount] >= 10000000 &&
        'Procurementdata'[Transaction Amount] <  25000000 ,
        "$10M-$25M",
        "<$10M"
    )
)

if result.png

 

Best Regards,
Yingjie Li

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

vjnvinod
Impactful Individual
Impactful Individual

@v-yingjl 

 

thank you it actually worked but its not coming in order

is it possible to  show  that in the below order?

.$25M at top

$10M-$25M

<$10M

 

Capture.PNG

Hi @vjnvinod ,

Based on your picture, seems to order it in a slicer, right?

Could not achieve it directly but you can create another column to mark each tag like a rank:

Column 2 =
IF (
    'Procurementdata'[Column] = ">$25M",
    1,
    IF ( 'Procurementdata'[Column] = "$10M-$25M", 2, 3 )
)

Click the three dots and choose sort by column2 and sort asc

slicer.png

 

Best Regards,
Yingjie Li

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

harshnathani
Community Champion
Community Champion

Hi,

 

Please try this Calculated Column

 

Column =
SWITCH (
    TRUE (),
    Procurementdata[Transaction Amount] >= 25000001">$25M",
    Procurementdata[Transaction Amount] >= 100000000
        && Procurementdata[Transaction Amount] <= 25000000"$10M - $25M",
    Procurementdata[Transaction Amount] < 10000000"<$10M"
)

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

edhans
Super User
Super User

Your && is causing the nesting to not work right. Can you post the text of the measure vs a screenshot? I'm not going to key that in to try and replicate the syntax issue and then fix it.

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.