Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Report Header using DAX

I am hoping this a simple one that I am over thinking... I have a report that makes use of some dynamic RLS which uses an access table built in to the report that looks like this: User_Email ...
  • v-lid-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    We can try to meet your requirement use following formula:

     

    Page_Title =
    VAR t =
        FILTER ( Access_Table, [User_Email] = USERPRINCIPALNAME () )
    VAR CompanyNumber =
        COUNTROWS ( t )
    RETURN
        IF (
            CompanyNumber = 0,
            "",
            IF (
                CompanyNumber = 1,
                MAXX ( t, [Company] ),
                MAXX ( TOPN ( 1, t, [Company], ASC ), [Company] )
            )
        )

     

    Or

     

    Page_Title =
    VAR t =
        FILTER ( Access_Table, [User_Email] = USERPRINCIPALNAME () )
    VAR CompanyNumber =
        COUNTROWS ( t )
    RETURN
        IF ( CompanyNumber = 0, "", MAXX ( TOPN ( 1, t, [Company], ASC ), [Company] ) )

     

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.