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
markhooten
Regular Visitor

Counting # of Completions of training and then displaying

Hello!

I have a data source that includes completions of up to 3 historical training topics by unique user ID.  I need my report to display only those folks who have completed all three.  For the Excel version of the report I used a COUNTIF and then only displayed those UserIDs that had a "3" in the results.  I'm not sure that will work with PowerBI, or what the best way is to achieve the goal.  

The report will show a total percentage of completion using stacked bars to indicate the number of staff who have completed all three of the historical items, or any one of the current items.

Example:

 

Example.png

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @markhooten 

COUNTIF function in Excel is to count the data in range. I think your code in Excel is like 

 

= COUNTIF(B2:B6,"3")/COUNT(A2:A6)

 

My Sample:

1.png

In Power BI try measures as below.

 

Measure = Divide(calculate(count(Table[ID],Filter(all(Table),Table[Result] =3)),Countax(All(Table),Table[ID])

 

If this reply still couldn't help you solve your problem, please share a sample with me by your Onedrive for Business. And I am confused about Alt1, Alt2, Current,Historical training in your Legend. I need to know more details about your calculate logic. 

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @markhooten 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

v-rzhou-msft
Community Support
Community Support

Hi @markhooten 

COUNTIF function in Excel is to count the data in range. I think your code in Excel is like 

 

= COUNTIF(B2:B6,"3")/COUNT(A2:A6)

 

My Sample:

1.png

In Power BI try measures as below.

 

Measure = Divide(calculate(count(Table[ID],Filter(all(Table),Table[Result] =3)),Countax(All(Table),Table[ID])

 

If this reply still couldn't help you solve your problem, please share a sample with me by your Onedrive for Business. And I am confused about Alt1, Alt2, Current,Historical training in your Legend. I need to know more details about your calculate logic. 

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

parry2k
Super User
Super User

@markhooten it will be easier if you can share sample pbix file with the expected output. 



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