Power BI Data Access, Transformation and Cleansing

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
 View Only
  • 1.  Dax Measure and return multiple columns

    Posted Dec 03, 2021 11:49 PM

    Hello Folks,

    I am filtering the data based on the current logged in user using the below query, now I would like to return some of the columns associated with that user - how to achieve that ? 

    In the below case I get only 1 value - I tried to return a complete row but it throws me the error "Multiple columns cannot be converted to a scalar value"  - any other way to show multiple columns?

    CurrentUserData =
    VAR CurrentUserState = CALCULATE(MAX(TimeReport[UserPrincipalName]),FILTER(TimeReport, TimeReport[UserPrincipalName] = USERPRINCIPALNAME()))
    SELECTEDVALUE(TimeReport[UserPrincipalName]) = CurrentUserState,

    F Mourtaza

  • 2.  RE: Dax Measure and return multiple columns

    Posted Dec 06, 2021 01:14 AM

    Got the solution and credit goes to @miguelarce

    WhoIsWatching = USERPRINCIPALNAME() 
    (that is email style usernames, or you can use USERNAME() for windows style users)



    Measure 2
    FilterByViewer = IF(selectedvalue(table[email])=[WhoIsWatching],1,0)



    Drag Measure 2 as a filter for visual, select advanced filtering and set it to 
    "Show items when value IS 1"


    F Mourtaza