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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

count function returns distinct count

CALCULATE(COUNT(table[field]),USERELATIONSHIP(table[datefield],calendar[datefield))

 

why would this return a distinct count ? 

 

I tried removing userelationship - same results.

5 REPLIES 5
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,


Does this issue have been resolved?Could you please provide more details about it If it still not be resolved? Please don't contain any Confidential Information or Real data in your reply.


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

CALCULATE(COUNT(table[field])) and CALCULATE(COUNTrows(table)) is same ?

If so this might be a unique column

 

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
Anonymous
Not applicable

The COUNT function returns the COUNT, not the distinct. If you have used a USERELATIONSHIP it might change the behaviour depending on the context but it should not. 

If the COUNT still return a distinct even without the USERELATIONSHIP that means that in the context of where you calculate that formula, the rows are DISTINCT in some way.

az38
Community Champion
Community Champion

@Anonymous 

maybe the isue in row context activated with CALCULATE() its unclear without data exampletry like

CALCULATE(COUNT(table[field]),ALL(table))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
parry2k
Super User
Super User

@Anonymous it is very hard to figure out what is going on based on the information you provided, you need to provide sample data, relationship information.

 

Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

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