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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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