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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
garythomannCoGC
Solution Supplier
Solution Supplier

FILTER path, why one method works and not the other?

As per the title why does 'path B' work and the commented out segment of code 'path A' does not?

 

 

 

EVALUATE

VAR ProgressList_Target =
    FILTER ( 
        SELECTCOLUMNS ( 
            'Measure Benefit Progress List',
            "MeasureID"   , 'Measure Benefit Progress List'[Main ID LkUpId]+0,
            "Financial Year"    , 'Measure Benefit Progress list'[Financial Year],
            "Target"      , 'Measure Benefit Progress list'[Revised]   -- value for 2027
        ),
        ---'Measure Benefit Progress list'[Financial Year] = "2026-27"   -- path A

            PATHCONTAINS ( "2026-27", [Financial Year] )   -- path B

    )

RETURN 
    ProgressList_Target

 

 

 

How to make 'path A' work?    The  https://dax.guide/filter/  guide example uses the exact same construct.

EVALUATE
FILTER (
    Customer,
    Customer[Continent] = "Europe"
)
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @garythomannCoGC 

Please try it this way

EVALUATE
VAR ProgressList_Target =
    FILTER (
        SELECTCOLUMNS (
            'Measure Benefit Progress List',
            "MeasureID", 'Measure Benefit Progress List'[Main ID LkUpId] + 0,
            "@FinancialYear", 'Measure Benefit Progress list'[Financial Year],
            "Target", 'Measure Benefit Progress list'[Revised]
        ),
        [@FinancialYear] = "2026-27"
    )
RETURN
    ProgressList_Target

View solution in original post

2 REPLIES 2
garythomannCoGC
Solution Supplier
Solution Supplier

Thanks @tamerj1 for your reply and code sample.  I see it clearly now 😂

tamerj1
Super User
Super User

Hi @garythomannCoGC 

Please try it this way

EVALUATE
VAR ProgressList_Target =
    FILTER (
        SELECTCOLUMNS (
            'Measure Benefit Progress List',
            "MeasureID", 'Measure Benefit Progress List'[Main ID LkUpId] + 0,
            "@FinancialYear", 'Measure Benefit Progress list'[Financial Year],
            "Target", 'Measure Benefit Progress list'[Revised]
        ),
        [@FinancialYear] = "2026-27"
    )
RETURN
    ProgressList_Target

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.

Top Solution Authors