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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Frequency between dates

Hi,

 

I am a basic BI user and need help with a measure.

 

I would also like an explanation of what you are doing so I can learn 🙂

 

I have a table of AAD logins.

 

Each login has a userID, loginCountry, loginDate.

 

I am looking to produce a table that shows for each loginCountry, how many high-frequency-logins (5 logins within 2 days) occured and when the first and last of thise were.

 

I appreciate you teachers.

3 REPLIES 3
Jihwan_Kim
Super User
Super User

HI,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

I assume the requirement is to find how many users are the high-frequency-login (more than five per each country) between two dates.

Please check the below picture and the attached pbix file.

 

Untitled.png

 

Login count measure: = 
COUNTROWS( Data )

 

High frequency login users: = 
SUMX (
    VALUES ( Country[Login Country] ),
    CALCULATE (
        COUNTROWS (
            FILTER (
                ADDCOLUMNS ( VALUES ( UserID[User ID] ), "@logincount", [Login count measure:] ),
                [@logincount] > 5
            )
        )
    )
)

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.
Anonymous
Not applicable

Hi Kim,

 

Many thanks for your time here.

 

This certainly seems like a good start. However, for this report the definiton of 'high frequency' is a user that has logged in 5 times or more at a specific location within a period of ANY 2 days.

 

I don't know when those 2 days might be, so using a slicer will not work. The measure I am trying to write must return 'users where 5 or more logins were made at an individual country within a 2 day period'.

I would like to see which country, user, date period.

 

So;

if user A logged in once a day for a week in London - i don't care.

If user A logged in 3 times on Jan 1st in Hawai and then 3 times on the 2nd in Paris - i don't care.

if user A logged in twice on Feb 1st in New York and 3 times on the 2nd in New York - i need to see that

if user A logged in twice on Mar 1st in Mexico and 3 times on the 2nd in Mexico - i need to that aswell

 

Many thanks again.

 

Terry

Hi,

Thank you for your message.
Sorry that I do not know how to create a sample that suits your situation, and please share your sample pbix file's link here. And then I can try to look into to it to come up with a more accurate solution.

Thanks.


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.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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