Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everybody,
i need to create a plot with two measurs:
1. amount of product over time
2. amout of group (of the product) over time
I have a table "orders" with the following columns:
1. date
2. group
3. product
4. amout
I have two slicer:
1. date-slicer
2. product-slicer to coose a single product
I tried to work with ALLEXCEPT and SELECTEDVALUE, but it didn't work.
CALCULATE(sum(orders[amount]);FILTER(ALLEXCEPT(orders;orders[date]);orders[group]=SELECTEDVALUE(orders[group])))
When I select e.g. the product A for the timeperiod January 18 to March 2018, than I need to see a line für the amount of A and another for the group of 1.
Here the table "orders":
date | group | product | amount |
Jan-18 | 1 | A | 100 |
Feb-18 | 1 | A | 200 |
Mar-18 | 1 | A | 150 |
Apr-18 | 1 | A | 100 |
Jan-18 | 1 | B | 250 |
Feb-18 | 1 | B | 100 |
Mar-18 | 1 | B | 100 |
Apr-18 | 1 | B | 100 |
Jan-18 | 1 | C | 50 |
Feb-18 | 1 | C | 20 |
Mar-18 | 1 | C | 50 |
Apr-18 | 1 | C | 80 |
Jan-18 | 2 | D | 100 |
Feb-18 | 2 | D | 200 |
Mar-18 | 2 | D | 300 |
Apr-18 | 2 | D | 400 |
Jan-18 | 2 | E | 200 |
Feb-18 | 2 | E | 100 |
Mar-18 | 2 | E | 200 |
Any ideas?
Kind regards.
Solved! Go to Solution.
Hi @Hering_W,
Try these two measures, please. You need to clear the context of Product in the second measure.
productAmount = sum(Table1[amount])
groupAmount = VAR selectedGroup = IF ( ISBLANK ( SELECTEDVALUE ( Table1[group] ) ), 1, SELECTEDVALUE ( Table1[group] ) ) RETURN CALCULATE ( SUM ( Table1[amount] ), FILTER ( ALL ( 'Table1'[group], Table1[product] ), Table1[group] = selectedGroup ) )
Best Regards,
Hi @Hering_W,
Try these two measures, please. You need to clear the context of Product in the second measure.
productAmount = sum(Table1[amount])
groupAmount = VAR selectedGroup = IF ( ISBLANK ( SELECTEDVALUE ( Table1[group] ) ), 1, SELECTEDVALUE ( Table1[group] ) ) RETURN CALCULATE ( SUM ( Table1[amount] ), FILTER ( ALL ( 'Table1'[group], Table1[product] ), Table1[group] = selectedGroup ) )
Best Regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |