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
PaulMac
Helper IV
Helper IV

DAX DISTINCTCOUNT Help needed

Hello all

I need some assitance with creating a DAX measure to do the following.

count the number of people who have scored more than or equal to 4, more than or equal to 3 or less than 3.

As can be seen in the SampleData file, I have filtered the data to only show those who have an average score below 3.

10 names appear in the filtered table, but the only DAX I have been able to produce give me a count of 13!!??

I need to produce a DAX measure that will correctly do a distinct count of the Names to give a numerical value of those whose Average QA score is above or below a certain threshold.

 

I need to learn how to accomplish this in Power BI using a DAX measure.

Click Here to see attached SampleData file to illustrate what I am trying to accomplish.

Thanks

PaulMc

1 ACCEPTED SOLUTION
RobbeVL
Impactful Individual
Impactful Individual

Hi,

 

Here I calcuated who has an average score ❤️

Measure = 
COUNTX(
    FILTER(
    SUMMARIZE('Table'; 'Table'[Name]; "av"; AVERAGE('Table'[Score]));
    [av] <3); 
DISTINCTCOUNT('Table'[Name]))

There might be an easier way, but this will work 🙂

Robbe

View solution in original post

6 REPLIES 6
RobbeVL
Impactful Individual
Impactful Individual

Hi,

 

Here I calcuated who has an average score ❤️

Measure = 
COUNTX(
    FILTER(
    SUMMARIZE('Table'; 'Table'[Name]; "av"; AVERAGE('Table'[Score]));
    [av] <3); 
DISTINCTCOUNT('Table'[Name]))

There might be an easier way, but this will work 🙂

Robbe

@RobbeVL Could explain why you used [av] and what does it do?

@RobbeVL  You sir, are a wizard!!

This is the second time this week you have helped me out!! I owe a coffee!! Smiley Wink

In all seriousness. do you have any online learning resources for DAX as I obviously need some further training in this field.

Many thanks again.

PaulMc

RobbeVL
Impactful Individual
Impactful Individual

I'm sure you'll find alot on youtube.
Udemy also has a few cheap trainings that might be of use. But make sure you do a PowerBI DAX training, PowerBI Doesnt support all DAX Functions.

Many thanks I will check those out.

 

Also, why did you use [av]

 

 

RobbeVL
Impactful Individual
Impactful Individual

Check out the SUMMARY function a bit more!

Comes to use quite often.

 

What I actually did with your calculation is the following:
 

SUMMARIZE: Create a virtual table from the table "table", group based on Name, THEN you add your calculation, in your case average Score.

 

Now you have a table with the names and next to it the column [av] (I named it that in summarize).

Next is Filtering that table to a avg score ❤️ by using the FILTER function.

 

Finally I want to convert my table to a single value. So I have to countx the remaining names in my table.

 

I hope this helps a litte ? 

 

Robbe

 

 

 

 

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.