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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
tomkribi
New Member

DAX Measure IF AND with multiple conditions

Hi

 

Can anyone help me with the following;

 

Measure =
IF (
    AND (
        CONTAINS (
            'table1',
            'table1'[FID_Custom], "TRUE"
        ),
        CALCULATE (
            CONTAINS (
                'table1',
                'table1'[Status], "Validated"
            )
        )
    ),
    1,
    0
)

 

=> I want to get all rows with 'table1'[FID_Custom]"TRUE" and  'table1'[Status] "Valiated" => currently I get only the "TRUE" once.

It is a IF condition with multiple selections.

 

Many thanks

2 ACCEPTED SOLUTIONS
AlB
Community Champion
Community Champion

Hi @tomkribi 

Try

Measure =
CALCULATE (
    COUNT ( 'table1'[FID_Custom] ),
    'table1'[FID_Custom] = TRUE (),
    'table1'[Status] = "Validated"
)

if FID_Custom  is of Boolean type. Or:

 

Measure =
CALCULATE (
    COUNT ( 'table1'[FID_Custom] ),
    'table1'[FID_Custom] = "TRUE",
    'table1'[Status] = "Validated"
)

 

if FID_Custom  is of text type.

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

View solution in original post

Great, many thanks, this is the solution for me

Measure =
CALCULATE (
    COUNT ( 'table1'[FID_Custom] ),
    'table1'[FID_Custom] = "TRUE",
    'table1'[Status] = "Validated"
)

View solution in original post

3 REPLIES 3
AlB
Community Champion
Community Champion

Hi @tomkribi 

Try

Measure =
CALCULATE (
    COUNT ( 'table1'[FID_Custom] ),
    'table1'[FID_Custom] = TRUE (),
    'table1'[Status] = "Validated"
)

if FID_Custom  is of Boolean type. Or:

 

Measure =
CALCULATE (
    COUNT ( 'table1'[FID_Custom] ),
    'table1'[FID_Custom] = "TRUE",
    'table1'[Status] = "Validated"
)

 

if FID_Custom  is of text type.

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

Great, many thanks, this is the solution for me

Measure =
CALCULATE (
    COUNT ( 'table1'[FID_Custom] ),
    'table1'[FID_Custom] = "TRUE",
    'table1'[Status] = "Validated"
)
Pragati11
Super User
Super User

Hi @tomkribi ,

 

There is a simpler way of writing your IF statement: (Create a caluclated column)

 

calcColumn = IF('table1'[FID_Custom] = "TRUE" && 'table1'[Status] = "Valiated", 1, 0)

 

If this doesn't help post some sample data and desired output.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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