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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RPATER
Frequent Visitor

DAX IF and FILTER in order to add a Flagged Column

Hello,

 

I am trying to add a flagged column to my visual for any row that has a Wave = 1 and a Delivery Rate < .85(85%).  

I have been trying to use IF and FILTER statements but have had no success.  The values continue to be returned as a 1 for every row regardless of wave or Delivery Rate.

 

Any help would be greatly appreciated!

 

Examples of Formulas used:

 

Risk = if(Query1[Wave]=1 && [Delivery_Rate]<.85,1,0)
 
Risk =
var Risk = CALCULATE([Delivery_Rate],Query1[Wave]=1)
return
if(Risk<.85,1,0)
 
ClientNameBrandNameWaveSentDeliveredDelivery_Rate
Client1Brand111962184094%
Client1Brand1193476782%
Client1Brand1192074781%
Client1Brand112052199297%
Client1Brand121989193997%
Client1Brand121916179994%
Client1Brand1285775288%
Client1Brand1282472188%
Client1Brand131963190897%
Client1Brand131897177093%
Client1Brand1384674087%
Client1Brand1378868687%
Client2Brand21353902952283%
Client2Brand21354462966784%
Client2Brand22326402886288%
Client2Brand22324492869088%

 

Thank You,

Ryan

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@RPATER , Wave seems like a column and Delivery Rate like a measure

 

Try one of the two

 

Risk =
var Risk = CALCULATE([Delivery_Rate],filter(Query1, Query1[Wave]=1))
return
if(Risk<.85,1,0)


Risk =
var Risk = CALCULATE([Delivery_Rate],filter(Query1, Query1[Wave]=1))
return
CALCULATE(if(Risk<.85,1,0), values(Query1[ClientName]), , values(Query1[BrandName]))

View solution in original post

Jihwan_Kim
Super User
Super User

Hi, @RPATER 

Please try the below.

 

Picture1.png

 

Risk =
IF ( SELECTEDVALUE ( Query1[Wave] ) = 1 && [Delivery_Rate] < .85, 1, 0 )
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @RPATER 

Please try the below.

 

Picture1.png

 

Risk =
IF ( SELECTEDVALUE ( Query1[Wave] ) = 1 && [Delivery_Rate] < .85, 1, 0 )
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


amitchandak
Super User
Super User

@RPATER , Wave seems like a column and Delivery Rate like a measure

 

Try one of the two

 

Risk =
var Risk = CALCULATE([Delivery_Rate],filter(Query1, Query1[Wave]=1))
return
if(Risk<.85,1,0)


Risk =
var Risk = CALCULATE([Delivery_Rate],filter(Query1, Query1[Wave]=1))
return
CALCULATE(if(Risk<.85,1,0), values(Query1[ClientName]), , values(Query1[BrandName]))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors