Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Need help in DAX

Hi experts,

 

I have a problems that need your help.

I got 3 table:

1. Fact Table: Login Event

2. Dim Table: Total users

3. Dim Table: Date

The relationship will look like below picture

 

In 1 report page:

- Filter: Date (from Date table)

- Chart 1: List of user had login in the given date filter

- Now I need to build, with the same given date filter, the list of NOT- LOGIN USER.

 

Please give me some advises.

 

Thanks in advance!!

  • Anonymous's avatar
    Anonymous
    5 years ago

    Anonymous 

     

    You can find not login users with NOT in Values() function:

    Not login users = CALCULATE(MAX('DIM total users'[user]), FILTER('DIM total users', NOT('DIM total users'[user]) in VALUES( Fact_Login event[user])))


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

3 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    Anonymous 

    Try:

    not logged in =

    VAR users = VALUES(DIM total users[user])

    VAR logged = VALUES(Fact_Login event[user])

    RETURN

    COUNTROWS(EXCEPT(users,logged))

     

    Create the visual/table/chart with the DIM total user[user] field, and in the filters for the visual in the filter pane add this measure [not logged in ] and establish the filter value as 1

    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous 

       

      You can find not login users with NOT in Values() function:

      Not login users = CALCULATE(MAX('DIM total users'[user]), FILTER('DIM total users', NOT('DIM total users'[user]) in VALUES( Fact_Login event[user])))


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