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

@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
ryan_mayu
Super User
Super User

@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!




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.