I have a table of movies with columns ‘movie title’ and ‘genre’. The view is a dashboard made up of a detail view and a deck. The detail view has the movie categories as enum buttons which the user can use to filter the deck.
Is it possible to have the enum buttons display the movie category and the count of movies in that category?
Yes it’s possible. Create a VC to concatenate the desired text first:
[Genre]&" ("&COUNT(MovieTable[Key], [Genre] = [_THISROW].[Genre])&")"
And then use this VC content to populate the ENUM buttons via Valid_if
[VirtualColumnName]
Brilliant. Thank you so much!
I’ve instituted your suggestion and it works perfectly, however, I should have also mentioned that users are able to edit genre’s, so the concatenated enum labels need to update as the users make changes. With your formula, when a row is edited, it makes a change to the Count for the genre of that row but not to the count of all of the rows in that genre (there’s a delay). Any way of making the VC update the Count for all rows in the category instantly?
The ENUM content can’t be edited by the user unfortunately. However if you switch the enum list’s expression from Valid_if to Suggested_Values, then the users will be able to type a new genre rather than editing the existing one. Ensure to check Auto-complete other values so that the newly typed/inserted genre will appear in the list next time.
I believe I couldn’t be able to understand this part. In general VC calculations are quick and there’s no delay as far as the data is in the back-end. Can you elaborate your issue here? May be with screenshots?
Hey @LeventK I misspoke, I didn’t mean users edit the genre’s, they are able to indicate whether they’ve watched the movie or not. The gif below shows a dashboard with the genre filter and then two deck views, Unwatched and Watched. The enum button is the concatenated genre+number in that genre with no user response. If you click the check mark, to indicate that you’ve watched the movie, it moves to the Watched deck and thus the number of movies in that genre should go down. As you can see, additional enum buttons are created because the underlying table with the concatenated Genre (count) isn’t updating fast enough.
If you want to add more value to your enum buttons in the movie dashboard, you could consider including additional details or labels on each button. For instance, instead of just displaying "Action" or "Comedy," you could append the number of movies available in each category. This provides users with a quick overview of the content without needing to filter first. It makes the dashboard more interactive and informative at a glance.
To implement this, you might need to use some formula expressions or actions within your app. If you’re working with AppSheet, for example, you could set up virtual columns that calculate the count of movies in each genre, and then use those values in your enum button display.
For more detailed guidance, you might want to check the AppSheet documentation or explore community forums where similar enhancements are discussed.
User | Count |
---|---|
18 | |
11 | |
7 | |
4 | |
3 |