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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
android1
Post Patron
Post Patron

Count Distinct but only SUM different numbers

Hi,

 

I want to sum the number of distinct times a number in Visit Num column occurs.  In pic below for e.g 250884 occurs twice. I only want to count this once & display a total sum. Using distinct count which is what the second column is sums everything.

 

sum.png

1 ACCEPTED SOLUTION
Chihiro
Solution Sage
Solution Sage

Are you using Table visual? If so, change it to Matrix visual.

 

Put [Visit Num] into Row field. Add measure DISTINCTCOUNT([Visit Num]) as value field.

View solution in original post

6 REPLIES 6
Chihiro
Solution Sage
Solution Sage

Are you using Table visual? If so, change it to Matrix visual.

 

Put [Visit Num] into Row field. Add measure DISTINCTCOUNT([Visit Num]) as value field.

Anonymous
Not applicable

@android1,

 

Can you try create this measure:

Count:= CALCULATE(COUNTROWS(Table))

Then place them intable with the Visit Number:

 

1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

Let me know if this helps. Thanks.

@Chihiro,

 

Yes, that works. TY.

@Anonymous,

 

Thanks. Not doing want I need unfortunately.

 

count.png

Anonymous
Not applicable

@android1,

 

 

Did you add a calculated column or a measure?

 

If you create a calculated column, you summarize the count as sum.

If it is a measure, you will set "Don't summarize" for the Visit Number.

 

1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Duc

@Anonymous,

 

Using a Measure as I'm in Direct Query.

 

Think I have it right but not doing what I need. See how Count is summing VisitNum twice, e.g 240035 is a count of 2 as it appears in Visit Num twice. Only need to sum it once.

 

summ.png

Helpful resources

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

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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