The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello everyone,
I want to calculate the sum of quantites of some products, but I have several problems. I am showing only the filtered data (based on all other categories except premium), and I want to calculate the sum of all the products where they are premium, but only for articles that are shown in the table. All of this, needs to be also calculated based on the data for the previous week (which I keep in other data table).
For example,
Article ID | Category | Total by category | Overall total |
123 | x | 3 | 100 |
234 | x | 1 | 20 |
123 | y | 32 | 100 |
123 | y | 1 | 100 |
I have used the following formula, and it calculates right, but the problem is if there is no total by category it returns a value, which is not what i want, and plus if there is no category it adds automatically some categories in the table.
VAR QUANTITY_PREVIOUS_WEEK =
CALCULATE(
SUM(Orders[packs]),
FILTER(ALL('Date'), 'Date'[Week rank]=PREVIOUS_WEEK),
FILTER(ALL(Orders[Category]), Orders[Category]="Premium")
)
Thank you in advance for your help.
Kind regards,
Stefani
Solved! Go to Solution.
I have solved my problem. It looked like I should show only the only that have no blank rows with total by category.
I have solved my problem. It looked like I should show only the only that have no blank rows with total by category.
User | Count |
---|---|
80 | |
78 | |
37 | |
34 | |
31 |
User | Count |
---|---|
93 | |
81 | |
60 | |
49 | |
49 |