AWS Quicksight - Top10 offices by REVENUE divided by REVENUE - amazon-quicksight

Is there a way to make a metric in Quicksight that is the ratio between TOP10 offices by REVENUE divided by REVENUE.
Thanks
The problem is that if I apply a filter to select the TOP10 offices by revenue in the numerator, the same filter is the apply to the denominator.

It was not clear from your question exactly what you meant by "ratio between TOP10 offices by REVENUE divided by REVENUE" but I have assumed you wanted the TOP N real total revenue by Store alongside the "ratio" or percent of total revenue of ALL revenue, not just the TOP N stores revenue.
To do this you can use the following calculated fields.
Make a calculated filler field to 'partition' by; that is you can use it to make a single partition of the whole data set, e.g. "single_partition_filler":
ifelse(isNotNull(store),1,0)
Make the ratio calculation you want, "Revenue over Total Revenue". The trick here is to use the "PRE_FILTER" aggregation level in the Table calculations so you are getting the sum of revenue by store PRE_FILTER divided by the sum of revenue by all stores (using the filler column) PRE_FILTER:
sumOver(revenue,[store],PRE_FILTER) / sumOver(revenue, [{single_partition_filler}], PRE_FILTER)
Make a table with "Store","Revenue (Sum)" and "Revenue over Total Revenue (Min)" and using a TOP N Filter for Store by Revenue (Sum). See Quicksight example below:
Compare with the same table unfiltered below:
Dataset used:
store,revenue
A,100
B,50
C,40
D,70
E,60
A,35
C,80

Related

Average sales per month per client Quicksight

Im fairly new to Quicksight and need help with the following:
I want to calculate the average sales in $ per month for each of my clients (Monthly Average by Client) and then categorize those clients in "A","B","C" categories where A > 250,000 monthly purchases, 100,000 < B <=250,000 and C <= 100,000.
The table I have is very similar to the following:
I tried using the following function:
avgOver(
sum(values_movement),
[contact,extract('MM',fecha)])
This function allows me to do the average but wont allow me to visualize it without selecting the month, given that I want to categorize the each client by their total monthly average, I cannot do a categorization based on a function that wont generate the client monthly average without selecting the month.
I know that once I get this function correct I can use ifelse() in order to categorize each client based on their monthly average transactions

How to recalculate the percentages from total when filtering in Power BI?

As I am not really sure how to express myself, I'll better demonstrate what I need to be done.
This is a sample DB.
You see here
that we have a category slicer and on the table is show the percentage of sales for a given product and its description.
On the next photo I used the slicer to filter the products on the "16GB" category. My task is when filtering, the total of the % to show 100% and the distinct products to show the percentage of this total (as part of the category, not of all other products and categories).
Thank you in advance!
You need to have a raw amount in your dataset. I was able to do this using this sample data.
Then for both table visuals in Power BI, you should select show value as percent of grand total for the amount value. This will allow Power BI to calculate the percentages dynamically as the filter criteria from the slicer changes.
Here is the result.

Power BI DAX formula for dynamic percentages with filter

I am new to Power BI and trying to create a simple card with percentages that will change when I select each category on my slicer. I need the nominator AND denominator to change with each filter - trying to achieve the '% of column total' function in Excel, but on this visual. This is a measure I created to calculate % of leavers over active, but it is not dynamic.
CALCULATE(COUNTA('Leaver'[ID]), /counta('Active'[ID])
My slicer has 3 regions: Central, Southern, Eastern. When filtered by Central, I need the card to show count of leavers from Central region out of total population in Central region. Currently the filter is working but the denominator pool is constant.

Is it possible to order split series in Kibana histograms using the values of the split buckets?

Say I have an index of product sales where each document is an individual sale for a specific product. I can use Kibana to chart a date histogram of sales counts, bucketing by every month. This would be the frequency of product sales every month. Here is an example:
Sales per Month
I can also split that series using a terms aggregation on the product name, so I end up with the distribution of those sales across each product each month like so:
Sales across Products per Month
What I can't do, which seems straightforward, is sort that distribution by the product count in that specific month. I can sort it alphabetically, or by the overall sales of that product, but I can't do it using the sales during that month. This means that if the most popular product overall is at the bottom of the bar (like the green product in the above image), it remains at the bottom always even if the sales count of that product for a particular month is lower than everything else.
Is it possible to order this series by the product count in each month? In general, is there a way to order a split series by the value of each 'split'?

On Query Viewer, how to show percentages based on Row totals (not Column total)?

I have been using the Query object for some time and I can not find how to show the percentage of a value over the total of the row.
On this Genexus Query Usage Example, it shows totals by Continent, Country and Attraction.
How this query must be configured to show the attractions percentage over row totals to get a result like this:
Those numbers in the image you posted come from a QueryViewer example. They represent the total sales of Soy, Wheat and Rice per Continent and Country. There are three different measures in this query, and you cannot make calculations among measures in the QueryViewer, so you can't achieve what you want with these numbers.
But you can modify or make your query so that there is only one measure, let's say "Sales amount", and the Crop can be one dimension:
Dimensions: Continent, Country and Crop
Measures: Sales amount
Once the data is presented like this, the percentage will show exactly what you want.
PS: By "dimension" I mean attributes without aggregation and by "measure" I mean those attributes that have any aggregation function (Sum, Average, etc.)

Resources