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
GJA
Helper II
Helper II

Dax measure to count and filter

Hi, 

 

I'am looking for a DAX measure (not a column) which can calculate the number of people who have 2 or more purchases. In this example the result should be 2. It looks pretty easy but I can't find the solution. Thx for your help.

 

PeoplePurchase
P1Pu1
P1Pu2
P1Pu3
P2Pu4
P3Pu5
P4Pu6
P4Pu7
1 ACCEPTED SOLUTION

It depends on your table structure. Assuming you have a single table called Table, this would work

 

=sumx(all(Table[People]),if(CALCULATE(countrows(table))>1,1))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

2 REPLIES 2

It depends on your table structure. Assuming you have a single table called Table, this would work

 

=sumx(all(Table[People]),if(CALCULATE(countrows(table))>1,1))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Hi Matt, 

 

thank you it works well

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.

Top Solution Authors