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.
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])))
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 |
---|---|
112 | |
99 | |
73 | |
72 | |
49 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |