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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
krichmond
Helper IV
Helper IV

Need help adding criteria to existing DAX formula.

I have this DAX statement that works but I need to add a second piece of criteria to row 10. I need to have both "Missing Media" OR "Reprocess File".

 

Has Missing Media? =
var _Column=
SELECTCOLUMNS(
    FILTER(ALL('Client Manager Report For Power BI'),'Client Manager Report For Power BI'[Event Id]=EARLIER('Client Manager Report For Power BI'[Event Id])),"1",'Client Manager Report For Power BI'[DBM Stage])
var _falg=
    CALCULATE(
    DISTINCTCOUNT('Client Manager Report For Power BI'[DBM Stage]),FILTER(ALL('Client Manager Report For Power BI'),'Client Manager Report For Power BI'[Event Id]=EARLIER('Client Manager Report For Power BI'[Event Id])))
return
IF(
    _falg =1 && "Missing Media" in _Column,TRUE(),FALSE())

 

Screenshot 2023-01-26 070144.png

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

I think you can use

Has Missing Media? =
VAR _Column =
    SELECTCOLUMNS (
        FILTER (
            ALL ( 'Client Manager Report For Power BI' ),
            'Client Manager Report For Power BI'[Event Id]
                = EARLIER ( 'Client Manager Report For Power BI'[Event Id] )
        ),
        "1", 'Client Manager Report For Power BI'[DBM Stage]
    )
VAR _falg =
    CALCULATE (
        DISTINCTCOUNT ( 'Client Manager Report For Power BI'[DBM Stage] ),
        FILTER (
            ALL ( 'Client Manager Report For Power BI' ),
            'Client Manager Report For Power BI'[Event Id]
                = EARLIER ( 'Client Manager Report For Power BI'[Event Id] )
        )
    )
RETURN
    IF (
        _falg = 1
            && ( "Missing Media"
            IN _Column
            || "Reprocess File" IN _Column ),
        TRUE (),
        FALSE ()
    )

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

I think you can use

Has Missing Media? =
VAR _Column =
    SELECTCOLUMNS (
        FILTER (
            ALL ( 'Client Manager Report For Power BI' ),
            'Client Manager Report For Power BI'[Event Id]
                = EARLIER ( 'Client Manager Report For Power BI'[Event Id] )
        ),
        "1", 'Client Manager Report For Power BI'[DBM Stage]
    )
VAR _falg =
    CALCULATE (
        DISTINCTCOUNT ( 'Client Manager Report For Power BI'[DBM Stage] ),
        FILTER (
            ALL ( 'Client Manager Report For Power BI' ),
            'Client Manager Report For Power BI'[Event Id]
                = EARLIER ( 'Client Manager Report For Power BI'[Event Id] )
        )
    )
RETURN
    IF (
        _falg = 1
            && ( "Missing Media"
            IN _Column
            || "Reprocess File" IN _Column ),
        TRUE (),
        FALSE ()
    )
TomasAndersson
Solution Sage
Solution Sage

Hi!
Have you tried just wrapping in an OR() statement? E.g.:

OR("Missing Media" in _Column, "Reproess file" in _Column)

 

@TomasAndersson - I am extremely new to DAX so I am not quite sure how to do that. Any chance you can send me what the modified line of code should look like? I tried the below and got this error.

 

Screenshot 2023-01-26 081735.png

Sure,

 

 

_falg = 1 OR("Missing Media" in _Column, "Reprocess file" in _Column), TRUE(), FALSE())

 

 

So you need to have the "in _Column" in both cases

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors