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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dwel0120
Helper III
Helper III

If Statement User Activity in Past Week based on Number of Logins

I am trying to mark a 1 in a new column IF the "user" has logged in 6 to 7 times (based on the Last Time Logged in Column) in the past 7 days from the "date of data" column (if not then 0). I also need to do this for 4 to 5 times logged in and 2 to 3 but if I get the 6-7 times then I can figure out the rest. I'm getting stuck on how to build the formula in DAX. 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @dwel0120 

Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.

All measures are in the sample pbix file, and you can follow the steps that are numbered in front of the measure name.

 

Picture2.png

 

 

https://www.dropbox.com/s/0u8fmytn88xbpag/dwel.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, @dwel0120 

Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.

All measures are in the sample pbix file, and you can follow the steps that are numbered in front of the measure name.

 

Picture2.png

 

 

https://www.dropbox.com/s/0u8fmytn88xbpag/dwel.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


amitchandak
Super User
Super User

@dwel0120 , try a new column like

if(countx(filter(table, [user] =earlier([user]) && [date of data] >=earlier([date of data]) -7 && [date of data] <= earlier([date of data])), user)+0>6,1,0)

@amitchandak That did not work. I still have 1s throughout the data and it is not limited to the past seven days from Date of Data. 

6-7 Days = if(countx(filter('All', 'All'[Last LMS Activity Completed] =earlier([Last LMS Activity Completed]) && [Date of Data] >=earlier([Date of Data]) -7 && [Date of Data] <= earlier([Date of Data])), 'All'[Last LMS Activity Completed])+0>6,1,0)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors