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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ahsanlhcgov
Helper III
Helper III

Showing distinct count of values in a colum

I have a table as below. the column lostoppo is a measure with formula 

 

LostOppo = CALCULATE(COUNT(vBIOppoFunnel[Opportunities]), FILTER(vBIOppoFunnel, vBIOppoFunnel[Opportunity Stage]="Lost"))

 

the values are not distinct in the column. I am trying to get distinct values which have the opportunity_stage as lost.

at the end I would like to have the percentage of the lost opportunities with the total number of opportunities for that framework. 

please can anyone help me with it.

 

 

 bi.PNG

1 ACCEPTED SOLUTION
v-caliao-msft
Employee
Employee

Hi @ahsanlhcgov,

 

I have tested it on my local environment, I can use DistinctCount without any issue.
Capture.PNG

Count = CALCULATE(COUNT(Sheet6[Category]),FILTER(ALLEXCEPT(Sheet6,Sheet6[Group]),Sheet6[Type]="T"))

DistinctCount = CALCULATE(DISTINCTCOUNT(Sheet6[Category]),FILTER(ALLEXCEPT(Sheet6,Sheet6[Group]),Sheet6[Type]="T"))

Capture1.PNG

So in your scenario, please check if you DAX is correct or not. If the issue persists, please provide us more details, so that we can make further analysis.

 

Regards,

Charlie Liao

View solution in original post

2 REPLIES 2
v-caliao-msft
Employee
Employee

Hi @ahsanlhcgov,

 

I have tested it on my local environment, I can use DistinctCount without any issue.
Capture.PNG

Count = CALCULATE(COUNT(Sheet6[Category]),FILTER(ALLEXCEPT(Sheet6,Sheet6[Group]),Sheet6[Type]="T"))

DistinctCount = CALCULATE(DISTINCTCOUNT(Sheet6[Category]),FILTER(ALLEXCEPT(Sheet6,Sheet6[Group]),Sheet6[Type]="T"))

Capture1.PNG

So in your scenario, please check if you DAX is correct or not. If the issue persists, please provide us more details, so that we can make further analysis.

 

Regards,

Charlie Liao

ahsanlhcgov
Helper III
Helper III

I have tried using distictcount but breaks the visual with error

Invalid column name. the exception was raised by the IDbCommand interface

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.