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

Simple IF testing on 0 & 1

Hello Power BI Community,

 

this question could seem a little dumd, but the fact that IF fucntion requires a function as a testing TRUE/FALSE has blocked me several times. In excel it is easy since you test each cells.

 

The case I have is very simple, I have in a column for each rows either 0 or 1.

So IF(C1=0; True ; false) IF(C2=0; True; false) IF(C3=1 ; True; flase) IF(,........) I need to test each rows and for this I need a function. I was thinking of a formula to test the MAXX number of each Rows but didn't get to that, Value doesnt works since we musst jave unic values,...

 

This simple condition testing should be easy but its not and I've been facing this matter more than once.

 

Thank you for you help 🙂

Regards

 

Mark Lovejoy

3 ACCEPTED SOLUTIONS
v-danhe-msft
Employee
Employee

Hi @Anonymous,

From your description, could you mean to judge each row in a column? If so, you could refer to below formula:

T/F = IF([Test]=0,TRUE(),FALSE())

Result:

1.PNG

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @Anonymous,

You could refer to below measure:

Measure = IF(CALCULATE(SUM(Table1[Number]))=0,TRUE(),FALSE())

Result:

1.PNG

Hope it could help you.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hello Daniel,

 

well the objective was not to create new data, so no I a DAX mesure is requirered and not a column formula.

 

I got to this solution: IF(SUMX( table, Column name = 1 ; Result if true,; resulat if false)

 

SUMX is an iterating function that is checking row after row informations.

 

Thanks for your help.

 

Mark

View solution in original post

6 REPLIES 6
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered to close this topic?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Sorry, didn't read your post correctly I mixed up the editors. This seems to work perfectly as well and since it is using claculate this fourmla seems miuch more flexible to evaluate text criteria.

 

Regards

Mark

Anonymous
Not applicable

Hello Daniel,

 

well the objective was not to create new data, so no I a DAX mesure is requirered and not a column formula.

 

I got to this solution: IF(SUMX( table, Column name = 1 ; Result if true,; resulat if false)

 

SUMX is an iterating function that is checking row after row informations.

 

Thanks for your help.

 

Mark

v-danhe-msft
Employee
Employee

Hi @Anonymous,

From your description, could you mean to judge each row in a column? If so, you could refer to below formula:

T/F = IF([Test]=0,TRUE(),FALSE())

Result:

1.PNG

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello Daniel,

 

yes this works using a column formula, but is there a way do it using a Measure?

 

Regards

 

Mark Lovejoy

Hi @Anonymous,

You could refer to below measure:

Measure = IF(CALCULATE(SUM(Table1[Number]))=0,TRUE(),FALSE())

Result:

1.PNG

Hope it could help you.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.