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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Count Distinct Name based on a Calculated Measure's Value

Hi,

 

As my name suggests, I'm a power bi newbie and I've tried searching the community for answers but it doesn't show me the solutions as expected.

 

I'm trying to get the distinct count of a measure based on the average stats where sales surpass say $5, 000.

 

Please see the sample below:

 

DateAgent NameSales AmountTeam Name
2-Aug-21Agent A $           3,333.73Team A
3-Aug-21Agent A $           6,484.11Team A
4-Aug-21Agent A $              321.61Team A
2-Aug-21Agent B $        10,502.31Team B
3-Aug-21Agent B $        13,316.60Team B
2-Aug-21Agent C $              240.94Team C
3-Aug-21Agent C $              341.55Team C
2-Aug-21Agent D $           6,935.82Team D
3-Aug-21Agent D $           7,316.62Team D
4-Aug-21Agent D $              528.74Team D

 

I've tried using this DAX formula but it always returns the overall distinct count of the table:

Measure1 = average(Sales Amount)

CALCULATE(
DISTINCTCOUNT( table1[Agent Name] ),
FILTER(table1, Measure1 >= 5000)
)
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

I don't particularly understand your needs. Do you want the count of sales over 5000 or the overall average ? Can you provide the results you need ?

If you want to count the number of Agent Names that have sold more than 5000, you can refer to the following measure.

Measure = CALCULATE(DISTINCTCOUNT('Table'[Agent Name]),FILTER('Table','Table'[Sales Amount.2]>5000))

You should change the type of the [Sales Amount.] from text to Decimal Number .

Ailsamsft_0-1628493915188.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous 

I don't particularly understand your needs. Do you want the count of sales over 5000 or the overall average ? Can you provide the results you need ?

If you want to count the number of Agent Names that have sold more than 5000, you can refer to the following measure.

Measure = CALCULATE(DISTINCTCOUNT('Table'[Agent Name]),FILTER('Table','Table'[Sales Amount.2]>5000))

You should change the type of the [Sales Amount.] from text to Decimal Number .

Ailsamsft_0-1628493915188.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ryan_mayu
Super User
Super User

@Anonymous 

what's the expected output? do you want distinctcount agents?

maybe you can try

Measure = 
VAR tbl=SUMMARIZE('Table (2)','Table (2)'[Agent Name],"avg",AVERAGE('Table (2)'[Sales Amount]))
return COUNTROWS(FILTER(tbl,[avg]>5000))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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