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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Elache
Regular Visitor

Distinct count for specific values

Hello

 

I am new to Power BI and am looking to do a specific calculation. I have day to day data on the performance of several channels (there are about 100). Some days these channels perform very well, and others, not so well. Some of them do not perform at all (their value is 0).


I would like to:
1- Find the channels that are performing well (whose sum of a column is therefore greater than 0)
2- For these channels separately, add up what they cost each day

I have found how to make a distinct sum but I can't do it only for the channels that match this condition (that the sum of their performance is greater than 0)...

 

Of course I can do it by doing a matrix modeling, but I need this intermediate calculation to display a very precise indicator and therefore need a measure that evolves with time... 

 

Any idea how to do it?

 

Thank you very much!

 

Have a nice day,

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Elache ,

 

Try like

 

calculate(Sumx(Summarize( Table, Table[Channel], Table[Cost]), [cost]) , TOPN(1, filter(allselected('Table'[Channel]), Table[Cost]>0) , Sum(Table[Cost]),desc), values(Table[Channel]))

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

View solution in original post

2 REPLIES 2
Elache
Regular Visitor

It did work perfectly! Thank you so much @amitchandak ; i was lost since so long!

amitchandak
Super User
Super User

@Elache ,

 

Try like

 

calculate(Sumx(Summarize( Table, Table[Channel], Table[Cost]), [cost]) , TOPN(1, filter(allselected('Table'[Channel]), Table[Cost]>0) , Sum(Table[Cost]),desc), values(Table[Channel]))

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors