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

Two Filter Conditions & Dax Error

Hi Everyone,

I need to filter data on 2 conditions. Can anyone help me out?

error: A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

Accessory Tiers = 
Var _tier1 = CALCULATE(SUM(TierGoals[TIER 0 - MAX]),FILTER(TierGoals,TierGoals[JOB FUNCTION]="RSM") && FILTER(TierGoals,TierGoals[ITEM]="Accessory Goal"))
Var _tier2 = CALCULATE(SUM(TierGoals[TIER 1 - MAX]),FILTER(TierGoals,TierGoals[JOB FUNCTION]="RSM") && FILTER(TierGoals,TierGoals[ITEM]="Accessory Goal"))
Var _tier3 = CALCULATE(SUM(TierGoals[TIER 2 - MAX]),FILTER(TierGoals,TierGoals[JOB FUNCTION]="RSM") && FILTER(TierGoals,TierGoals[ITEM]="Accessory Goal"))
Var _tier4 = CALCULATE(SUM(TierGoals[TIER 3 - MAX]),FILTER(TierGoals,TierGoals[JOB FUNCTION]="RSM") && FILTER(TierGoals,TierGoals[ITEM]="Accessory Goal"))
Var _tier5 = CALCULATE(SUM(TierGoals[TIER 4 - MAX]),FILTER(TierGoals,TierGoals[JOB FUNCTION]="RSM") && FILTER(TierGoals,TierGoals[ITEM]="Accessory Goal"))
Var _ActualGoal = [Accessory % TO GOAL]
Return
IF(_ActualGoal>=_tier1,_tier1,IF(_ActualGoal>=_tier2,_tier2,IF(_ActualGoal>=_tier3,_tier3,IF(_ActualGoal>=_tier4,_tier4,0))))

 

1 ACCEPTED SOLUTION
edhans
Super User
Super User

Try this syntax for your two conditions. You don't need two FILTER statements:

    CALCULATE(
        SUM( TierGoals[TIER 0 - MAX] ),
        FILTER(
            TierGoals,
            TierGoals[JOB FUNCTION] = "RSM"
                 && TierGoals[ITEM] = "Accessory Goal"
        )
     )


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

1 REPLY 1
edhans
Super User
Super User

Try this syntax for your two conditions. You don't need two FILTER statements:

    CALCULATE(
        SUM( TierGoals[TIER 0 - MAX] ),
        FILTER(
            TierGoals,
            TierGoals[JOB FUNCTION] = "RSM"
                 && TierGoals[ITEM] = "Accessory Goal"
        )
     )


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.