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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
irenelitw629
Helper II
Helper II

Distinct count of number based on sales amount

Hi everyone,

 

I have one set of sales date as per below example. I want to create a measure to get distinct count of opportunity parent when the sales amount is  >=$1m.

Sales quarterOpportunity Parent numberOpportunity NumberProductSales Amount
22-Q2OPTY5071363OPTY5071363TF $ 1,638,334
22-Q2OPTY5052097OPTY5052097IM $ 405,441
22-Q2OPTY5052097OPTY5075331IM $ 800,000
22-Q1OPTY5080075OPTY5080075CF $ 1,500,000

 

I have sales quater and product filter in the visualization - so the filter needs to apply to the measure as well.

For example, when no sales quarter is selected, the distinc parent number count should be 3.

When IM product is selected, it should be 1 distinc parent number count.

Sales quarterOpportunity Parent numberOpportunity NumberProductSales Amount
22-Q2OPTY5052097OPTY5052097IM $ 405,441
22-Q2OPTY5052097OPTY5075331IM $ 800,000

 

Any idea what should be the measure? I have tried filter all, Allselected, group by but it is not working.

 

Here is the sameple file

https://drive.google.com/file/d/1MeOON5tvU4ARZjRLoUOy6GPFOZMnpDlr/view?usp=sharing

 

Thanks!!

2 REPLIES 2
irenelitw629
Helper II
Helper II

Thanks Amit. It works but only when account name is in the table. Is there anyway to show this as scorecard without pulling account name in the table?

amitchandak
Super User
Super User

@irenelitw629 , Try measure like

calculate( countx(filter(summarize(Table, Table[Opportunity Parent number], "_1", sum(Table[Sales Amount])), [_1] > 1000000),[Opportunity Parent number]) ,
filter(allselected(Table) , Table[Opportunity Parent number] = max( Table[Opportunity Parent number])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Solution Authors