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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
DanNewton
Regular Visitor

Distinct count of users who clicked x and y (example data included!)

Hi all, I have a requirement to create a count of distinct users who clicked both x and y using website analytic data. After some researching I am struggling to understand how to do this and would welcome any suggestions/help.

 

I have included a screenshot of sample data as the forum software kept removing the HTML table:

sample.PNG

From the table above the resulting measure shoud show a count of 2, i.e. 2 distinct users clicked BOTH X and Y.

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@DanNewton 

Pls try this

MEASURE = 
var tbl=SUMMARIZE(FILTER('Table','Table'[Clicked]="X" || 'Table'[Clicked]="Y"),'Table'[USER_ID],"COUNT",DISTINCTCOUNT('Table'[Clicked]))
RETURN COUNTROWS(FILTER(tbl,[COUNT]=2))




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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@DanNewton 

Pls try this

MEASURE = 
var tbl=SUMMARIZE(FILTER('Table','Table'[Clicked]="X" || 'Table'[Clicked]="Y"),'Table'[USER_ID],"COUNT",DISTINCTCOUNT('Table'[Clicked]))
RETURN COUNTROWS(FILTER(tbl,[COUNT]=2))




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

Proud to be a Super User!




amitchandak
Super User
Super User

@DanNewton , Try a measure like this with user ID

 

countx(filter(summarize(Table, Table[User], "_1", calculate(distinctcount(Table[Clicked]), filter(Table, Table[Clicked] in {"X", "Y"}))),[_1] =2),[User])

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors