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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
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)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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