Do you have any duplicates in your dataset? Can a supplier have only 1 invoice per day? What’s the granularity of your dataset? Does each row of the dataset represent represent one invoice? If you have line items in your dataset, that could also be another source of duplicates.
Hi,
My granularity is [supplier_number and invoice_number]. There can be more than one invoices in a day.
But I do need the average basis supplier_number.
With the way that you wrote your calculated field, when you add it to your Value field well, you still have to select an aggregation. Can you check what aggregation you selected there?
Avg for Supplier 123 = (100+150)/2 = $125
The $200 doesn’t count since it doesn’t satisfy your condition.
Avg for Supplier 456 = $130
If you want a KPI, it means you want QuickSight to give you a single value. What do you want QuickSight to do with the $125 and $130 to give you that single value? Do you want the average, i.e., (125+130)/2? What is your expected result here?
Hi David,
Thanks for your detailed analysis on my query.
The usage of the dashboard is to filter out only ONE supplier number at a time so it should show $125. The users check every supplier one by one and make further decisions based on that.
If multiple supplier numbers are selected, it may show an overall average (125+130)/2.
For my validations, I tried filtering only one supplier, it was able to capture the minimum and maximum date correctly but the average came out incorrect.
Is the result incorrect for all suppliers or only for some suppliers? It will be difficult to troubleshoot this without seeing your raw unaggregated data. The calculated field appears to be correct but there may be other factors in the data that we’re not taking into account. If you can choose one supplier for which the result is incorrect and show the raw data for that supplier, it will help.
Hi @sakshisl, I am marking this reply as, “Solution,” in case you need further assistance with your problem, please create a sample dashboard with sample dataset showing your problem state using Arena and please create a new post, so we can look at it from a fresh perspective. (Details on using Arena can be found here - QuickSight Arena)