Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi Everyone.
I need your help on this.
I have two table ( Item table and Sales Table). I have a slicer for item number("No") from the item table and a relationship between the two tables. The table are shown below.
Item Table
No | Gen No | Desc 1 | Desc 2 |
1 | - | Dog | Black |
2 | 1 | Dog 2 | White |
3 | - | Dog 3 | Gold |
4 | 1 | Dog 4 | White and Black |
5 | - | Dog 5 | Spotted |
6 | 1 | Dog 6 | Brown |
Sales Table
No | Gen No | Desc 1 | Desc 2 | Qty |
1 | - | Dog | Black | 4 |
2 | 1 | Dog 2 | White | 5 |
3 | - | Dog 3 | Gold | 8 |
4 | 1 | Dog 4 | White and Black | 6 |
5 | - | Dog 5 | Spotted | 2 |
6 | 1 | Dog 6 | Brown | 1 |
If i select "No" =1 from the slicer, i want to check on the sales table where the "No" =1 and also where the "Gen No" = 1 and i want to get the result table below
No | Gen No | Desc 1 | Desc 2 | Qty |
1 | - | Dog | Black | 4 |
2 | 1 | Dog 2 | White | 5 |
4 | 1 | Dog 4 | White and Black | 6 |
6 | 1 | Dog 6 | Brown | 1 |
I hope i was descriptive enough.
Try if this can solve
QTY_1 = calculate(sum(qty), filter(all(sales),sales[No]=allselected(sales[No]) || sales[Gen No]=allselected(sales[No])))
Use QTY in your table.
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
Many thanks @amitchandak .
However, the expression did not work. It showed "Cant display the visual" when i tried to use it.
There is a link to see the error. what is the error it is giving
MdxScript(Model) (33, 182) Calculation error in measure 'Sales'[QTY_1]: A table of multiple values was supplied where a single value was expected.
Try if in can work. else provide sample pbix.
QTY_1 = calculate(sum(qty), filter(all(sales),sales[No] in allselected(sales[No]) || sales[Gen No] in allselected(sales[No])))
User | Count |
---|---|
94 | |
83 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
62 |