cancel
Showing results for
Did you mean:
Anonymous
Not applicable

Visualizing the amount of rows with a specific condition

Hey everyone, I have a question. I have a table with multiple columns (the Health column is a calculated column, which is calculated by other columns in this table, in case that is of importance) which looks something like this (in reality there are more rows and columns):

 ID Date Health in % TF 1 1.1.2020 99 TF 3 4.1.2020 68 TF 4 19.1.2020 91 TF 4 5.2.2020 76 TF 7 10.2.2020 92 TF 8 12.2.2020 78

I now want to count the number of rows, i.e. products, who's health lies in a specific range of percentage, so I would like to count the number of entries who's health lie in the range 100%-95%, then how many lie in 95%-90% and so on. Then I would like to visualize these results in form of a bar chart (my idea so far) where the x-axis are those percentage ranges and the y-axis is the amount of entries.

Now counting isn't the problem. So far I have been adding calculated columns where each column is one of those ranges and then I have filtered the rows which lie in them. From then on you can count the rows by using the COUNTROWS operator and I could work from there. But this seems like far too much work for such a 'simple' task. Is there a better way to do this that I am not aware of?

Any help would be appreciated. THANKS!!

1 ACCEPTED SOLUTION
Super User II

@Anonymous

you can try use SWITCH()

``Column = SWITCH(TRUE(),Sheet41[Health in %]>95,"95-100",Sheet41[Health in %]>90,"90-95")``

Proud to be a Super User!

2 REPLIES 2
Super User IV

@Anonymous , refer if these can help

Proud to be a Super User!

Super User II

@Anonymous

you can try use SWITCH()

``Column = SWITCH(TRUE(),Sheet41[Health in %]>95,"95-100",Sheet41[Health in %]>90,"90-95")``

Proud to be a Super User!

Announcements

Happy New Year from Power BI

This is a must watch for a message from Power BI!