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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.