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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
MattAllington
Community Champion
Community Champion

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.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

2 REPLIES 2
MattAllington
Community Champion
Community Champion

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.
I will not give you bad advice, even if you unknowingly ask for it.

Hi Matt, 

 

thank you it works well

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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