admin管理员组

文章数量:1122846

I have the following requirement:

Design an .rdl report (multipage) that is hosted in Power BI. The report must have several interactive filters enabled that a user will select to filter out only required information.

I was able to implement one filter with the following DAX expression:

DEFINE VAR __DS0Core = 
    FILTER( SUMMARIZE(
        'User List',
        'User List'[Description],
        'User List'[Email],
        'User List'[FacilityName],
        'User List'[FirstName],
        'User List'[LastName],
        'User List'[SiteName],
        'User List'[Username],
        'User List'[LastLogin]
     ),
        PATHCONTAINS(@Program, 'User List'[Description])
    )

EVALUATE
    __DS0Core

ORDER BY
    'User List'[Description],
    'User List'[Email],
    'User List'[FacilityName],
    'User List'[FirstName],
    'User List'[LastName],
    'User List'[SiteName],
    'User List'[Username],
    'User List'[LastLogin]

Where @Program is a parameter defined on the report

I am stuck now because it seems that PATHCONTAINS doesn't take more than one argument. I need to implement 3 more filters: FacilityName, SiteName, and LastLogin

I just started leaning DAX 2 days ago and seems that my t-SQL experience isn't easily transferable to DAX. Any help would be appreciated.

I have the following requirement:

Design an .rdl report (multipage) that is hosted in Power BI. The report must have several interactive filters enabled that a user will select to filter out only required information.

I was able to implement one filter with the following DAX expression:

DEFINE VAR __DS0Core = 
    FILTER( SUMMARIZE(
        'User List',
        'User List'[Description],
        'User List'[Email],
        'User List'[FacilityName],
        'User List'[FirstName],
        'User List'[LastName],
        'User List'[SiteName],
        'User List'[Username],
        'User List'[LastLogin]
     ),
        PATHCONTAINS(@Program, 'User List'[Description])
    )

EVALUATE
    __DS0Core

ORDER BY
    'User List'[Description],
    'User List'[Email],
    'User List'[FacilityName],
    'User List'[FirstName],
    'User List'[LastName],
    'User List'[SiteName],
    'User List'[Username],
    'User List'[LastLogin]

Where @Program is a parameter defined on the report

I am stuck now because it seems that PATHCONTAINS doesn't take more than one argument. I need to implement 3 more filters: FacilityName, SiteName, and LastLogin

I just started leaning DAX 2 days ago and seems that my t-SQL experience isn't easily transferable to DAX. Any help would be appreciated.

Share Improve this question edited Nov 21, 2024 at 19:16 itisinteresting asked Nov 21, 2024 at 19:07 itisinterestingitisinteresting 1472 silver badges12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

DAX demystified. ;) I used && to provide multiple path conditions.

DEFINE VAR __DS0Core = 
    FILTER( SUMMARIZE(
        'User List',
        'User List'[Description],
        'User List'[Email],
        'User List'[FacilityName],
        'User List'[FirstName],
        'User List'[LastName],
        'User List'[SiteName],
        'User List'[Username],
        'User List'[LastLogin]
     ),
   (PATHCONTAINS(@Program, 'User List'[Description])) && 
   (PATHCONTAINS(@FacilityName, 'User List'[FacilityName])) &&
   (PATHCONTAINS(@SiteName, 'User List'[SiteName])) &&
   (PATHCONTAINS(@LastLogin, 'User List'[LastLogin]))
    )

EVALUATE
    __DS0Core

ORDER BY
    'User List'[Description],
    'User List'[Email],
    'User List'[FacilityName],
    'User List'[FirstName],
    'User List'[LastName],
    'User List'[SiteName],
    'User List'[Username],
    'User List'[LastLogin] 

本文标签: