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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.