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

Return how many times it appear within a week

Hi, 

I am having a month of data and want to create a new column that returns true/false on the devices visit any locations more than 3 times a week before getting this I tried to get the number of visits per week, have tried a few different methods by myself but still could not get it right. If anyone has any ideas, please advise me.

 

This is a dummy dataset of how the actual data looks like:

DateTimeLocationDevicesWeek Number of visits per week (This column is what I want)
2020-01-015:07:39AMA00:11:22:33:44:5512
2020-01-017:02:02AMA00:11:22:33:44:5512
2020-01-018:12: 13 AMA00:11:22:33:44:5512
2020-01-019:12:54AMC66:44:77:88:99:0014
2020-01-0110:00:12AMB00:11:22:33:44:5512
2020-01-028:12: 13 PMB66:44:77:88:99:00 14
2020-01-0511:02:02AMA00:11:22:33:44:5512
2020-01-06 7:42:02AMA66:44:77:88:99:0014
2020-01-071:23:34PMC66:44:77:88:99:0014
2020-01-086:07:34AMA00:11:22:33:44:5523
2020-01-108:22:12AMA00:11:22:33:44:5523
2020-01-1010:22:12AM C00:11:22:33:44:5523
2020-01-1212:23:45PMB00:11:22:33:44:5523
2020-01-1211:22:12AMC66:44:77:88:99:0022
2020-01-1410:43:16AM B66:44:77:88:99:0022

 

I have tried this and but this returned how many times the devices appeared on each date and location: 

Number of visit per week =
COUNTX(
FILTER ('data', EARLIER([Devices]) = [Devices] && EARLIER([Date]) = [Date] && EARLIER([Location]) = [Location]),
'data'[Devices])

 

 

 

Thanks!

5 REPLIES 5
amitchandak
Super User
Super User

I tried like this. But seems does not match with your no. Can explain how you got those number

cal week = COUNTX(FILTER(Sheet1,Sheet1[Location]=EARLIER(Sheet1[Location]) && Sheet1[Devices]=EARLIER(Sheet1[Devices]) && Sheet1[Week ]=EARLIER(Sheet1[Week ])),Sheet1[Devices])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Anonymous
Not applicable

Hi, the table is a little misleading because the column line is missing, I am having Date, Time, Location, Devices, Week, Number of visits per week (This is the column I want).

Hi @Anonymous ,

 

Is this table your expected result? If is, could you explain how to get 2 and 4 in first week?

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Hi @v-eachen-msft, the number of visits per week is the column that I want to find (or calculate), the number of visits per week is based on the devices, I am hoping to find how many days each device appeared per week, no matter which location it appears and how many times it appears at one location. 

Hi @Anonymous ,

 

Try this although  result didn't match what is in your table (but this is based on your description):

Number of Visits Per Week =
CALCULATE (
    COUNTROWS ( 'Table' ),
    ALLEXCEPT ( 'Table', 'Table'[Week ], 'Table'[Devices] )
)

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.