Forum Discussion
Count (Distinct): DAX equivalent or rename table header
- 9 years ago
In this scenario, since you want to calculate the distinct count within each State, you should have your calculation group on "State". Please use formula like:
Number of Clubs:=CALCULATE(DISNTICTCOUNT('MY TABLE'[CLUB_NUMBER]),ALLEXCEPT('MY TABLE','MY TABLE'[State]))
Regards,
Hi hksl
There is no option to rename the table headers.
In your case, You should create a neW measure, which will allow you to customize your header.
Number of Clubs:=DISNTICTCOUNT('MY TABLE'[CLUB_NUMBER])
Thank you, but Number of Clubs:=DISNTICTCOUNT('MY TABLE'[CLUB_NUMBER]) does not work.
It seems to produce sum of club numbers ?
State Count of CLUB_NUMBER Number of Clubs
CA 933 2733
CO 41 2733
FL 8 2733
. . . . . . . . .
- BhaveshPatel9 years agoSuper User
Hi hksl
You have applied my formula in calculated column but the formula is for the measure calculation. This is the reason you are getting unexpected results. Practically, Both your distinct count steps and my DAX formula are same aggregations and it must show the same result. I tried and tested.
- v-sihou-msft9 years agoMicrosoft Employee
In this scenario, since you want to calculate the distinct count within each State, you should have your calculation group on "State". Please use formula like:
Number of Clubs:=CALCULATE(DISNTICTCOUNT('MY TABLE'[CLUB_NUMBER]),ALLEXCEPT('MY TABLE','MY TABLE'[State]))
Regards,