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
Anonymous
Not applicable

Countax / Countx is not funcitoning well

Hi,

 

I have an issue regarding creating correct dax formula. 

 

I have two tables.

  • Team table: unique identifier
  • All data table

I want to get the total right, to show how many people who have at least 75 reviews.

 

Below is the formulas I've tried, but non of them works to get the total right. 

 

Formula 1 tried: 

  • CALCULATE(DISTINCTCOUNT('All data table'[WorkerID]), FILTER('All data table', DISTINCTCOUNT('All data table'[Reviewid]) >= 75))

Formula 2 tried:

  • Var Review 75 =  COUNTAX(VALUES('All data table'[WorkerID]), DISTINCTCOUNT(All data table[Reviewid]) >= 75)
    Var CountTotal = SUMMARIZE('All data table', 'All data table'[WorkerID], "WorkerIDs", Review75)
    Return
    IF(HASONEVALUE('All data table'[WorkerID]), Review75, COUNTAX(CountTotal, [WorkerIDs]))

Formula 3 tried:

  • IF(HASONEVALUE(Team[WorkerID]), CALCULATE(DISTINCTCOUNT('All data table'[WorkerID]), FILTER('All data table', DISTINCTCOUNT('All data table'[Reviewid]) >= 75)), CountX(DISTINCT(Team[WorkerID]), CALCULATE(DISTINCTCOUNT('Team'[WorkerID]), FILTER('All data table', DISTINCTCOUNT('All data table'[Reviewid]) >= 75))))

Formula 4 tried:

  • IF(HASONEVALUE('Team'[WorkerID]), IF(DISTINCTCOUNT('All data table'[Reviewid]) >= 75, 1, BLANK()),
countax(DISTINCT('Team'[WorkerID]), DISTINCTCOUNT('All data table'[Reviewid]) >= 75))
 
Below is the result
Capture.PNG
 
The total is not matching the calculation result, should be 4 instead of 8.
The purpose I tried all different formulas is to get the total right, which should be 4.
I was using countax and countx, and none of this formula works.
 
Could you help me with the formula please?
 
Thank you!
1 ACCEPTED SOLUTION

HI @Anonymous ,

 

Please check on below link:

Measure Totals, The Final Word

 

If above not help, you can upload sample file to onedrive or google drive then share link here.
Notice: do mask on sensitive data.


Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

 

It seems like a common total level calculate issue on measure formulas, please refer to following blog about measure calculated on total level:

Measure Totals, The Final Word

 

If above not help, please share a pbix file with some sample data for further test.


Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi,

 

This is what I see when I click the link.

 

Capture.PNG

 

Thanks

HI @Anonymous ,

 

Please check on below link:

Measure Totals, The Final Word

 

If above not help, you can upload sample file to onedrive or google drive then share link here.
Notice: do mask on sensitive data.


Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.