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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nagaraj
Post Patron
Post Patron

Group BY and COUNT

Hi All,

 

Need help with the DAX for the below scenario.

 

I have column (STATE) in a table , now i need to create a measure called STATE_COUNT.

Data for the new column will be count of each STATE

 

ad.jpg

 

Regards
Nagaraj

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@nagaraj 

Try like

calculated(count(table[state]),allexcept(table[state]))

Also refer : https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

 

Appreciate your Kudos.

View solution in original post

4 REPLIES 4
FrankAT
Community Champion
Community Champion

Hi @nagaraj,

see figure:

12-03-_2020_11-24-33.png

 

 

 

 

 

 

 

Regards FrankAT

amitchandak
Super User
Super User

@nagaraj 

Try like

calculated(count(table[state]),allexcept(table[state]))

Also refer : https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

 

Appreciate your Kudos.

@amitchandak 

 

 For the below scenario, let's say i have a country column as well.

And lets say BANGALORE is part of COuntry 1 and Country 2 ... i need to count seperately based on Coutnry.

 

At present, the expression is counting all BANGALORE regardless of the Country.

 

Any Idea?

 

Regards

Nagaraj

 

Hi Amit,

 

 Thanks for the help, it worked 🙂

 

Regards

Nagaraj

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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