cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omenomen
Frequent Visitor

Returning true or false based on multiple criteria

I have a table as below called (Results) which has 4 columns [Name], [Age], [Country],[Position]

 

[Client]      [Sites]      [Country]    [Position]

Parker            2               UK               1

Peters            2               UK               1

Allens            1               UK               2

Farmer           6             Wales            2

Parker            1              Wales           3

Parker             4            France           3

Allens            5              France          101

Peters            3              France         105 

Allens             1              France         108

 

I would like to introduce a DAX Measure or a Calculated Column to create another column [Healthy] as the table below

 

This new column in based on the following criteria taken from the [Position] column

 

(Results)[Position]<=2 or >=100 (less than or equal to 2 or greater than or equal to 100)

 

[Client]      [Sites]      [Country]    [Position]  [Healthy]

Parker            2               UK               1           True

Peters            2               UK               1            True

Allens            1               UK               2            True

Farmer           6             Wales            2            True

Parker            1              Wales           3            False

Parker             4            France           3            False

Allens            5              France          18           False

Peters            3              France         105          True 

Allens             1              France         108          True

 

What would be the simplest way to calculate this?

 

Thanks for your time.

 

1 ACCEPTED SOLUTION

What is the result you want? If my understanding is incorrect, please correct me.

Your expectation result should be :

After summarize column [Client], [Sites], [Country] , 
if sum ( [Position] )  <= 2  and  sum[position]>=100 then Ture else False 

or : if avg ( [Position] )  <= 2  and  avg [position]>=100 then Ture else False 
Which kind of aggregation is what you want ?

View solution in original post

3 REPLIES 3
rfigtree
Resolver III
Resolver III

calculated column and if statement.

 

= if(table[position] <= 2 || table[position]>=100, true(),false())

omenomen
Frequent Visitor

Sorry columns are [Client], [Sites], [Country],[Position]

What is the result you want? If my understanding is incorrect, please correct me.

Your expectation result should be :

After summarize column [Client], [Sites], [Country] , 
if sum ( [Position] )  <= 2  and  sum[position]>=100 then Ture else False 

or : if avg ( [Position] )  <= 2  and  avg [position]>=100 then Ture else False 
Which kind of aggregation is what you want ?

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

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.

Top Solution Authors
Top Kudoed Authors