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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Yarafat
Frequent Visitor

doubly value from distinct count with Positive Value

Hi Team,

 

I need your help to get the Distinc count formula. i have data of Secondary sales . I need to see the product wise distinc Outlet count who have a positive sales. In our business Day 1 we have create a invoice for outlet and day 2 we are going to deliver the product in outlet , But some outlet the Returing the Product which have order by Day 1. That means we create positive Sales at Day 1 and Negetive sales at Day 2. An example : 

Sample Data
DateOutlet CodeProduct codeQty
9/20/2018CT0013035
9/21/2018CT001303-3
9/20/2018CT0023037
9/21/2018CT002303-7
9/20/2018CT0063039
9/21/2018CT006303-5
9/20/2018CT0033034
9/20/2018CT0033037
9/20/2018CT0043037
9/20/2018CT0014045
9/21/2018CT001404-3
9/20/2018CT0024047
9/21/2018CT002404-7
9/20/2018CT0024049
9/21/2018CT002404-5
9/20/2018CT0034044
9/20/2018CT0084049
9/20/2018CT008404-9
9/20/2018CT011404-9
9/20/2018CT0034047
9/20/2018CT0044047

 

Pivot table for Getting Positive sales outlet in sheet. 

Pivot table for getting Positive sales outlet
Product CodeOutlet CodeSum of Qty
303CT0012
 CT0020
 CT00311
 CT0047
 CT0064
404CT0012
 CT0024
 CT00311
 CT0047
 CT0080
 CT011-9
Grand Total 39

 

Final Expectec resutl :

final Result
Product CodeDistinc Outlet count
3034
4044

 

 

Pls. find the attached link for sample file. drive Link : "https://drive.google.com/file/d/1WsgQrXXNZnqK8GgKlPGaCtuID3XPfTFM/view?usp=sharing" 

 

 

Regards 

Yeasin 

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

The expected result of 4 for each, that is not counting the negative and 0's in your second table, correct?

 

In general, you would do something like:

 

Measure = 
VAR _code = MAX([Product Code])
RETURN
COUNTROWS(FILTER(SUMMARIZE('Table',[Product Code],[Outlet Code],"__Qty",SUM([Qty])),[Product Code] = __code))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi Greg, 

 

I have tried but it's not working. Pls. find the attached file how i create the measure. 

 

Pls. help me solved it. Here the file link: " https://drive.google.com/drive/folders/1tT_Gi_ca2Q3AJgBWzH0Ne31ISVinHS0r?usp=sharing "

 

Regards,

Yeasin 

Hi Greg,

 

Yes, You are right. I am not counting the negative and 0. Can you pls. share with me the sample PBIX file , I have already share with my data by Drive link. It will be very help full for me.

 

Regards,

Yeasin

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.