Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to count value based on another count aggregate

Hi community,

This may seem like a stupid question but I am fairly new to PowerBI so I  require your aid.

I have a table with users, and their unique event_dates of logons.

I guess my task constists of two things:

1) First - the below table displays how many unique event dates I have for each individual (How many unique days I see atleast 1 login) -> which is basically count(event_date)

I need to have another table where I can aggregate the number of these emails by company, but with a specific filter with above certain days of unique days activity. So for example, in the picture above I have 5 emails, where the first one has logged in 20 different days. On a separate table I need to have the company and to be able to count emails that have logged atleast >10 times. Which should result in Company A, Email_Count : 1, since only user meets the criteria.

After this has been achieved, I want to have a dynamic filter where the user can put the treshold himself. So if he is not satisfied with >10 condition, let's say he makes it > 2 , this should return two emails in that company.

So in short, I need to count the event dates for each individual, then count the individuals that meet certain amount of count event dates, and then filter by the count of event_dates so it can be flexible.

Is that possible? Thanks!

2 Replies