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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
ianboothman
Frequent Visitor

Distinctcount

Good Evening 

 

I have a table relating to sales and I would like to find the voulme of unqiue sales orders.

 

My current DAX 

unique order number =DISTINCTCOUNT(Statles2[Sales Ord])
is giving a flase number. I do have a location filter panel on the page. But even with no loaction selected the unique values is still incorrect. 

ianboothman_0-1737564010208.png

Can someone please help. 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@ianboothman Can you elaborate on why you feel the number you are getting is incorrect? That should give you a distinct count of Sales Ord. You could try replacing that with this code:

Measure = COUNTROWS( DISTINCT( SELECTCOLUMNS( 'Table', "__SalesOrd", [Sales Ord] ) ) )

But, again, both DISTINCTCOUNT and that measure should return the same number. 



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...

View solution in original post

2 REPLIES 2
Bibiano_Geraldo
Super User
Super User

Hi @ianboothman ,

If i undertood well, you want to count only unique Sales ord (that appears only one time, with no duplicates), this can be reached by this DAX:

Unique Sales Orders = 
COUNTROWS(
    FILTER(
        SUMMARIZE(
            'Statles2', 
            'Statles2'[Sales Ord], 
            "Count", COUNTROWS('Statles2')
        ), 
        [Count] = 1
    )
)

 

Your result will look like this, because there's only one sales order that appears once:

Bibiano_Geraldo_0-1737568602976.png

 

 

Greg_Deckler
Community Champion
Community Champion

@ianboothman Can you elaborate on why you feel the number you are getting is incorrect? That should give you a distinct count of Sales Ord. You could try replacing that with this code:

Measure = COUNTROWS( DISTINCT( SELECTCOLUMNS( 'Table', "__SalesOrd", [Sales Ord] ) ) )

But, again, both DISTINCTCOUNT and that measure should return the same number. 



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...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.