cancel
Showing results for
Did you mean:
Helper III

## Percentage of the selected sum by condition.

There is a table that has values like below.
There are lines that say "Not OK". The number of these lines is 100%
How can I make a graph and a filter so that when I select a specific problem, I see how many percent of such lines are from the total number of lines, where are they in the Not OK status?
I tried the "Percentage of Grand Total" option in the values menu, but obviously it doesn't show what I want.

 id Status Problem 1 OK 2 Not OK 1 3 OK 4 OK 5 OK 6 Not OK 2 7 OK 8 OK 9 OK 10 Not OK 3 11 Not OK 1 12 Not OK 2 13 OK 14 OK 15 OK 16 OK 17 OK 18 Not OK 4 19 Not OK 4 20 OK 21 Not OK 2 22 Not OK 3 23 OK 24 OK 25 OK
1 ACCEPTED SOLUTION
Community Support

Hi @uk141 ,

Will "sum (number of Not OK)" be filtered by month? If it will ,try the first measure, if not, try second.

``````measure1 =
var select_count=calculate(count('table'[id]),filter(all('table'),'table'[month]=selectedvalue('table'[month])&&'table'[problem]=selectedvalue('table'[problem])&&'table'[status]="Not OK"))
var all_count=calculate(count('table'[id]),filter(all('table'),'table'[month]=selectedvalue('table'[month])&&'table'[status]="Not OK"))
return
select_count/all_count

measure2 =
var select_count=calculate(count('table'[id]),filter(all('table'),'table'[problem]=selectedvalue('table'[problem])&&'table'[status]="Not OK"))
var all_count=calculate(count('table'[id]),filter(all('table'),'table'[status]="Not OK"))
return
select_count/all_count``````

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
5 REPLIES 5
Super User

Hi, @uk141

I am not sure if I understood your question correctly, but please check the below picture and the sample pbix file's link down below whether it is what you are looking for.

All measures are in the sample pbix file.

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Helper III

Not. The axis should be the month, which I did not show in the example.
To the left of the visualization there should be a Slicer, which allows you to select the desired problem and see on the graph the number of lines with this problem / sum (number of Not OK)

Community Support

Hi @uk141 ,

Will "sum (number of Not OK)" be filtered by month? If it will ,try the first measure, if not, try second.

``````measure1 =
var select_count=calculate(count('table'[id]),filter(all('table'),'table'[month]=selectedvalue('table'[month])&&'table'[problem]=selectedvalue('table'[problem])&&'table'[status]="Not OK"))
var all_count=calculate(count('table'[id]),filter(all('table'),'table'[month]=selectedvalue('table'[month])&&'table'[status]="Not OK"))
return
select_count/all_count

measure2 =
var select_count=calculate(count('table'[id]),filter(all('table'),'table'[problem]=selectedvalue('table'[problem])&&'table'[status]="Not OK"))
var all_count=calculate(count('table'[id]),filter(all('table'),'table'[status]="Not OK"))
return
select_count/all_count``````

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Super User

@uk141 , Try one of the two measure

divide(calculate(count(Table[ID]), filter(Table, search("Not OK",Table[Status],,0)>0)), calculate(count(Table[ID])))

divide(calculate(count(Table[ID]), filter(Table, search("Not OK",Table[Status],,0)>0)), calculate(count(Table[ID]), allselected(Table)))

Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
Helper III

Both are not. I need a Slicer on the side, which would allow me to show only a certain problem, but to see not just the quantity, but the quantity with this problem / the quantity Not OK of everything.

Announcements