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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
vivekravi
Frequent Visitor

Count the number of occurences of a value in a table, even when a filter is applied

Hello,

 

I am trying to calculate the percentage completion of a task.

 

Columns are Date and name of employees.

 

vivekravi_1-1726253961832.png

 

So when i filter for a particular date or month, I should get the percentage of employees who completed their checks. Both COMPLETED and NOT APPLICABLE counts as COMPLETED.

 

For example, if i select, July 25, then i should get 100 % (6 COMPLETED and 1 NOT APPLICABLE)

if i select September 5, then i should get then i should get 42.85% (2 COMPLETED, 1 NOT APLLICABLE and 4 NOT COMPLETED, so 3/7).

 

Similarly if i select the Month august, i should get 74.28% (only 9 of 35 NOT COMPLETED).

 

I am trying to display this in a card.

 

Appreciate your help.

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@vivekravi 

you can select date column and unpivot other columns in PQ

11.png12.PNG

 

 

Then create a measure

 

Measure = CALCULATE(count('Table'[Attribute]),FILTER('Table','Table'[Value]<>"NOT COMPLETED"))/COUNT('Table'[Attribute])
 
13.PNG
 
pls see the attachment below




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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
vivekravi
Frequent Visitor

Hello @ryan_mayu ,

 

Thank you so much for this. I still wanted to display my solution as shown in the image, so I think it would be good to duplicate the data source and unpivot the columns for the measure and retain the original one to display the information as a table.

ryan_mayu
Super User
Super User

@vivekravi 

you can select date column and unpivot other columns in PQ

11.png12.PNG

 

 

Then create a measure

 

Measure = CALCULATE(count('Table'[Attribute]),FILTER('Table','Table'[Value]<>"NOT COMPLETED"))/COUNT('Table'[Attribute])
 
13.PNG
 
pls see the attachment below




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

Proud to be a Super User!




Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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