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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
TechR21
Helper V
Helper V

"AND" statement DAX

Hi ,

 

Im trying to have a column containing either 1 or 0 depending on following condition in DAX:

 

"OpenIncident", IF ( AND(
        CALCULATE (
            COUNTROWS ( 'tableA' ),
            ALLEXCEPT (
                'tableA',
                'tableA'[SubGroup],
                'tableA'[incidentNumber]
            ),
            'tableA'[Change Status] in {"Logged", "Waiting", "Updated"})
           ,
 
        CALCULATE (
            COUNTROWS ( 'tableA' ),
            ALLEXCEPT (
                'tableA',
                'tableA'[SubGroup],
                'tableA'[incidentNumber]
            ),
            
            'tableA'[Status Name] in {"Logged", "Updated","In progress"})
 
        ) > 0,
        1,
        0
        )
)
 
So if both statements are true, it should give me a "1" in the column, otherwise "0"
 
 
I keep getting following error but cant seem to make it work:
DAX comparison operations do not support comparing values of type True/False with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.
1 ACCEPTED SOLUTION
Shubham_Tekade
Frequent Visitor

Hello,

 

"OpenIncident", IF ( AND(
        CALCULATE (
            COUNTROWS ( 'tableA' ),
            ALLEXCEPT (
                'tableA',
                'tableA'[SubGroup],
                'tableA'[incidentNumber]
            ),
            'tableA'[Change Status] in {"Logged", "Waiting", "Updated"})
           ,
 
        CALCULATE (
            COUNTROWS ( 'tableA' ),
            ALLEXCEPT (
                'tableA',
                'tableA'[SubGroup],
                'tableA'[incidentNumber]
            ),
            
            'tableA'[Status Name] in {"Logged", "Updated","In progress"})
 
        ) ,-- This will giving you true/ flase in output and here you are trying to compare with like (True/false)>0. this will not work.
        1,
        0
        )
 
try this it will work for you I think so.
 
thanks.
 
 
 

View solution in original post

2 REPLIES 2
Shubham_Tekade
Frequent Visitor

Hello,

 

"OpenIncident", IF ( AND(
        CALCULATE (
            COUNTROWS ( 'tableA' ),
            ALLEXCEPT (
                'tableA',
                'tableA'[SubGroup],
                'tableA'[incidentNumber]
            ),
            'tableA'[Change Status] in {"Logged", "Waiting", "Updated"})
           ,
 
        CALCULATE (
            COUNTROWS ( 'tableA' ),
            ALLEXCEPT (
                'tableA',
                'tableA'[SubGroup],
                'tableA'[incidentNumber]
            ),
            
            'tableA'[Status Name] in {"Logged", "Updated","In progress"})
 
        ) ,-- This will giving you true/ flase in output and here you are trying to compare with like (True/false)>0. this will not work.
        1,
        0
        )
 
try this it will work for you I think so.
 
thanks.
 
 
 

yes this works. After reading the error again I figured something with the last part should be wrong. thank you

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.