Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello everyone,
Thank you for your time, I'm struggling creating a measure, hopefully you guys can help me.
Basically it's a countifs in excel but I just can make it work in DAX. Here's an example in excel:
I need to replicate that in PBI (Measure, column in light blue). The problem is that I can't make it count each variable in the columns that I'm using, here's what I have so far:
I tried using the grouby option but it would take away other columns that I need after this gets done. I highly appreciate any help given! Thank you for your time!
Solved! Go to Solution.
Hi, @Anonymous ,
In this case you need to use EARILER(). (see screenshot below)
Column =
CALCULATE (
COUNT ( Sheet1[Date] ),
'Sheet1'[Customer ID] = EARLIER ( Sheet1[Customer ID] ),
'Sheet1'[Date] = EARLIER ( Sheet1[Date] ),
ALL ( Sheet1 )
)
Mark this post as solution if this helps,thanks!
Hi @DavisBI,
I also have a similar problem, however I am not getting the desired outcome from the solution that you provided. I am attaching a screenshot, kindly please take a look at it.
So what I want is that, if Ash's name pops up for the first time for Forbes then the count should be 1. However, if it again pops up for the same company i.e. Forbes for Ash, then I want it to count as 2, as it is coming for the 2nd time and so on.
I am attaching an excel sample also, for you to understand what excel formulae I am using.
I hope this helps. Kindly please help. I am also open to alternate solutions.
Thank you,
Regards,
Saumitra Upadhyaya
Hi, @Anonymous ,
In this case you need to use EARILER(). (see screenshot below)
Column =
CALCULATE (
COUNT ( Sheet1[Date] ),
'Sheet1'[Customer ID] = EARLIER ( Sheet1[Customer ID] ),
'Sheet1'[Date] = EARLIER ( Sheet1[Date] ),
ALL ( Sheet1 )
)
Mark this post as solution if this helps,thanks!
Davis!
Thank you so much for your help! This is exactly what I was looking for!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |