cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sya
Helper I
Helper I

IF Function with 2 Conditions and 2 Type

Hi All,

 

No. of RSO SentAgeing - JO IN to RSO (days)
4NO DATA
46
21
22
22
13
13
1NO DATA

 

I tried to create a measure that meets the following conditions: 3 RSO Sent Within 3 Working Days

 

So I used the following formula: 

3 RSO Sent in 3 Days = if(VALUE(Tracker[Ageing - JO IN to RSO])<=3 && VALUE(Tracker[No. of RSO Sent])>=3,"Yes","No")
 
But it resulted in the following error:
sya_0-1652247900314.png

Please advise on the correct formula. Thanks a lot.

 

Sya

 

1 ACCEPTED SOLUTION

Hi @sya 

 

You can create a calculated column to get you the output you're after:

 

Column = 

SWITCH (
TRUE () ,
'Table'[Ageing - JO IN to RSO (days)] = "NO DATA" , BLANK() ,
VALUE ( 'Table'[No. of RSO Sent] ) >= 3 && VALUE ( 'Table'[Ageing - JO IN to RSO (days)] ) <= 3 , "Yes" ,
"No" )

Attached is a PBIX file to assist.


Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

5 REPLIES 5
TheoC
Super User
Super User

Hi @sya 

 

Slightly modify your measure to the following:

 

3 RSO Sent in 3 Days = IFERROR ( IF ( VALUE Tracker[Ageing - JO IN to RSO] ) <= 3 && VALUE Tracker [No. of RSO Sent] ) >= "Yes" "No" ) , 0 )
 
So all you are doing is wrapping your existing measure with IFERROR ( [existing measure] , 0 ) which says if there's an error, then just return a 0. If you want it to be blank, then just change the 0 to BLANK() like below:
 
3 RSO Sent in 3 Days = IFERROR ( IF ( VALUE Tracker[Ageing - JO IN to RSO] ) <= 3 && VALUE Tracker [No. of RSO Sent] ) >= "Yes" "No" ) , BLANK() )
 
Hope this helps!
 
Theo 🙂
 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Hi Theo,

 

I tried the formula that u shared but it results in the following:

 

sya_1-1652248892810.png

And the formula doesn't suggest columns that are already in the table, but only suggested my other created measures to be in the formula.

 

Sya

Hi @sya 

 

You can create a calculated column to get you the output you're after:

 

Column = 

SWITCH (
TRUE () ,
'Table'[Ageing - JO IN to RSO (days)] = "NO DATA" , BLANK() ,
VALUE ( 'Table'[No. of RSO Sent] ) >= 3 && VALUE ( 'Table'[Ageing - JO IN to RSO (days)] ) <= 3 , "Yes" ,
"No" )

Attached is a PBIX file to assist.


Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

It's working! Thanks a lot, Theo. You rock! 🙂

Nothing at all @sya! A pleasure.

 

All the best with you BI journey mate!

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

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

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors