cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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 DateHealth in %
TF 11.1.202099
TF 34.1.202068
TF 419.1.202091
TF 45.2.202076
TF 710.2.202092
TF 812.2.202078

 

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
Super User II

@Anonymous 

you can try use SWITCH()

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

1.PNG





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
Super User II
Super User II

@Anonymous 

you can try use SWITCH()

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

1.PNG





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

Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

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

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors