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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Milozebre
Helper V
Helper V

If a cell contains true then 1

Hello Dear Community, 

 

I have a question. 

I have a table like that : 

L1L2L3Result expected 
TrueTrueTrue1
TrueTrueFalse1
TrueFalse True1
TrueFalse False1
FalseFalse True1
FalseTrueTrue1
FalseFalse False0

 

If he is one true on column then 1

If only false then 0

 

Can you help me please ?

 

Thank you.

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Milozebre 

 

Download this sample PBIX file with these examples.

 

Are they text values or Boolean True/False?

Do you want to do this in Power Query or DAX?

try this in Power Query assuming the column is text

 

if [L1] = "False" and  [L2] = "False" and  [L3] = "False" then 0 else 1

 

 

In DAX create this calculated column assumgin the column is True/False (Boolean)

 

Column = IF ([L1] = FALSE() && [L2] = FALSE() && [L3] = FALSE(), 0, 1)

 

 

If the columns are text then use this DAX

Column = IF ( CONTAINSSTRING('Table_Text'[L1], "False") && CONTAINSSTRING('Table_Text'[L2], "False") && CONTAINSSTRING('Table_Text'[L3], "False"), 0, 1)

 

tfvals.png

 

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
timg
Solution Sage
Solution Sage

Hi Milozebre,

This calculated column should work:

 

Result =
SWITCH (
    TRUE (),
    'Table'[L1] = TRUE ()
        || 'Table'[L2] = TRUE ()
        || 'Table'[L3] = TRUE (), 1,
    0
)

 

1.PNG

Best regards,

Tim





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

Proud to be a Super User!




PhilipTreacy
Super User
Super User

Hi @Milozebre 

 

Download this sample PBIX file with these examples.

 

Are they text values or Boolean True/False?

Do you want to do this in Power Query or DAX?

try this in Power Query assuming the column is text

 

if [L1] = "False" and  [L2] = "False" and  [L3] = "False" then 0 else 1

 

 

In DAX create this calculated column assumgin the column is True/False (Boolean)

 

Column = IF ([L1] = FALSE() && [L2] = FALSE() && [L3] = FALSE(), 0, 1)

 

 

If the columns are text then use this DAX

Column = IF ( CONTAINSSTRING('Table_Text'[L1], "False") && CONTAINSSTRING('Table_Text'[L2], "False") && CONTAINSSTRING('Table_Text'[L3], "False"), 0, 1)

 

tfvals.png

 

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hello @PhilipTreacy 

 

Thank you for the solution, its works 🙂

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.