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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
iamprajot
Responsive Resident
Responsive Resident

CountIf as CountAX

Hi, I am using this to count the repetition of CustomerID for each row

CALCULATE(COUNTROWS(Orders),ALLEXCEPT(Orders,Orders[CustomerID]))

 

Is it possible without Calculate to count the occurences of a String in a column and get the result in Column

Something like 

COUNTAX(Orders,ALLEXCEPT(Orders,Orders[CustomerID]))

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

Yes but you syntax is incorrect:

 

COUNTAX(ALLEXCEPT(Orders,Orders[CustomerID]),[CustomerID])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

It's giving me the overall total count in each row.

@iamprajot

 

I think using ALLEXCEPT as table expression in X - ITERATORs typically yields circular dependency error

 

=
COUNTAX (
    FILTER ( Orders, Orders[Customer ID] = EARLIER ( Orders[Customer ID] ) ),
    [Customer ID]
)

@Zubair_Muhammad

It's working but I looking for something based on just COUNTAX and ALLEXCEPT and no use of Filtering or Earlier or any other function.

Hi, @Greg_Deckler/@Zubair_Muhammad

You seems to be having a good catch on DAX and how to use it to get the desired result.
I have 1 question for you, how can I be better at DAX and get the complete understanding of utilizing the DAX functions to get the desired result.

I mean what you would suggest based on your experience that helped.

Books do not cover functions deeply as much as they should so what do you suggest that really helps.

Any specific Book/PDF/This Community/Any other source.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors