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
laxmikantpatil
Frequent Visitor

Count number of unique items

I have two tables as below

Name  Target

a            3

b            2  

c            1

d            2

 

Name Job Status

a           x      Complete

a           y     Incomplete

b          z       Incomplete

a          w      Incomplete

b          u       Complete

c          o        Complete

d          p        Incomplete

d          l         Complete

 

Now I want a new column in table to count number of completed jobs by a person and in the second column no. of incomplete jobs. (Just the count) So that I can see what percent of job is completed.

 

Please help.

Thank You

2 ACCEPTED SOLUTIONS

Without more details of your model or data I would guess you have a typo in your table and column reference.  Let the intellsense complete the phrase when referencing the needed column to be sure it is correct rather than typing it.  

 

here is the demo file I made for your example in the orig post.  Not getting the same error you show... 

 

https://www.dropbox.com/s/z2ghfczksfxzd1l/SolveCompletedDIstinct.pbix?dl=0

 

 

 

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

@laxmikantpatil  - to get the % you can add this measure:

Percent Complete = 
DIVIDE(
    CALCULATE(COUNTROWS(YourTable), YourTable[Status] = "Complete"),
    COUNTROWS(YourTable)
)
I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.
Nathan Peterson

Hi it doesn't give me the exact count corresponding to the right name.

@laxmikantpatil Try this: 

Solvelaxmikantpatil.JPG

 

 

I am getting this warning

PBI.PNG

Can you share your file? Or at least an image of your data model? Hard to debug as I dont know your model or data set

Without more details of your model or data I would guess you have a typo in your table and column reference.  Let the intellsense complete the phrase when referencing the needed column to be sure it is correct rather than typing it.  

 

here is the demo file I made for your example in the orig post.  Not getting the same error you show... 

 

https://www.dropbox.com/s/z2ghfczksfxzd1l/SolveCompletedDIstinct.pbix?dl=0

 

 

 

Great Thank You

It worked

Thanks a million

Yes this works.

Can you tell me how did you calculate no. of completed jobs.

I have calculated but it took 5 steps of editing.

Please let me know if there is a simple way.

See the bottom of the image....

 

Completed Jobs = CALCULATE(DISTINCTCOUNT(Results[Job]),Results[Status]="Complete")

PS - please mark this as solved if the solution is helpful! 

 

Cheers! 

I have two different data tables.

Will this be valid for two different data sets too?

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.