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

Value and Distinct function giving same result

I am using two tables "Category" and "Product"

vimina_vinod_0-1612351444763.png

vimina_vinod_1-1612351506235.png

Below is the output which I am getting:

vimina_vinod_2-1612351633574.png

Ideally Distinct function should calculate the value excluding the blank. But here Value and Distinct is giving me the same result. 

Here is the definition which I used:

Products DISTINCT = COUNTROWS(DISTINCT('Product'[Product]))
Products VAL = COUNTROWS(VALUES('Product'[Product]))
1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

Modify measure Products DISTINCT as below:

Products DISTINCT = IF(MAX('Product'[Category]) in FILTERS(Category[category Id]),CALCULATE(DISTINCTCOUNT('Product'[Product])),BLANK())

And you will see:

1.png 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

Modify measure Products DISTINCT as below:

Products DISTINCT = IF(MAX('Product'[Category]) in FILTERS(Category[category Id]),CALCULATE(DISTINCTCOUNT('Product'[Product])),BLANK())

And you will see:

1.png 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Tahreem24
Super User
Super User

@Anonymous ,

It works perfect. As you dont have blank records in your Product column. If you count for Category so it may give you right result because you have blank records in Category.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

@Anonymous , You are getting blank because your category table does not have all categories. The calculation is correct

 

you can also try

Products DISTINCT = DISTINCTCOUNT('Product'[Product])

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