How to display the result of a virtual column

I'm having hard time trying to display the result of a virtual column as a single number. For example, I have a table such as this

 

PersonFruit
JohnOrange
Mary Apple
GeorgeApple
SallyBerry
BillOrange

I have a Virtual Field that calculates the number of instances of each fruit.

 

COUNT( SELECT( [Fruit] , [Fruit] = [_THISROW].[Fruit] ) )

 

This works perfectly fine. However, I can't find a way to display that result i a nice fashion. What I would like is a view that looks something like this:

Apple: 2

Berry:  1

Orange: 2

Is this possible?  

Thanks.

 

 

Solved Solved
0 3 98
  • UX
1 ACCEPTED SOLUTION

Yeah, that’s totally doable, but not with a regular table view out of the box. Here’s what I’ve done in a similar case:

1. Create a new table (let’s call it Fruit Summary) with just one column: Fruit.
2. Add a virtual column in that table, something like:
COUNT(SELECT(OriginalTable[Fruit], [Fruit] = [_THISROW].[Fruit]))
3. Then use a Deck View or Card View on Fruit Summary, that gives you the clean layout you’re looking for, like:
Apple – 2
Orange – 2
Berry – 1

You can even tweak it with formatting rules if you want to color-code the counts or fruit types. I’ve used this pattern to show tag usage and status breakdowns, works great when you want a quick summary without hacking slices or reports.

View solution in original post

3 REPLIES 3

Yeah, that’s totally doable, but not with a regular table view out of the box. Here’s what I’ve done in a similar case:

1. Create a new table (let’s call it Fruit Summary) with just one column: Fruit.
2. Add a virtual column in that table, something like:
COUNT(SELECT(OriginalTable[Fruit], [Fruit] = [_THISROW].[Fruit]))
3. Then use a Deck View or Card View on Fruit Summary, that gives you the clean layout you’re looking for, like:
Apple – 2
Orange – 2
Berry – 1

You can even tweak it with formatting rules if you want to color-code the counts or fruit types. I’ve used this pattern to show tag usage and status breakdowns, works great when you want a quick summary without hacking slices or reports.

Thanks, that works!

Hello try use this in yout virtual field
[Fruit] & ": " & COUNT(SELECT(Persons[Fruit], [Fruit] = [_THISROW].[Fruit]))
This works for each record, But if you want all the fruits summarized, then apply the solution of @Homer-Ross 

Regards

Top Labels in this Space