March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi guys,
I have two tables connected with a 1-many relationship
Item_table
item_code | case_qty |
1028445 | 6 |
Picks_table
Item_code | Qty_picked | item_size | Picker_id |
1028445 | 42 | 90ct 990mg | abc |
1028445 | 24 | 90ct 990mg | abc |
1028445 | 750 | 90ct 990mg | abc |
1028445 | 30 | 90ct 990mg | abc |
The actual qty picked is 141 because the picked is case of 6 eaches. Hence, 846/6 = 141 cases
Why does it not aggregate to the measure value i.e., 141.
It is currently showing a total value.
The measure I wrote for Actual qty_picked is as follows,
Solved! Go to Solution.
Hi,
Ensure that you have a seperate table called Item_Code will all unique items listed in that table. There should be a replationship (Many to One and Single) from the Item_code column of both tables to the Item code column of the 2 tables that you have. To your visual, drag Item code from the new table. Write these measures:
Case qty = sum(item_table[case_qty])
Picked qty = sum(Picks_table[qty_picked])
Measure = divide([Picked qty],[Case qty])
Measure1 = averagex(values(Item_code[Item_code],[Measure])
Hi, @gunasai
Can you show your more records in item_table?
I think you need to check whether the return value of MIN(item_table[Case_qty]) is 6 rather than 1.
Best Regards,
Community Support Team _ Eason
Thank you for your reply!
Hi,
Ensure that you have a seperate table called Item_Code will all unique items listed in that table. There should be a replationship (Many to One and Single) from the Item_code column of both tables to the Item code column of the 2 tables that you have. To your visual, drag Item code from the new table. Write these measures:
Case qty = sum(item_table[case_qty])
Picked qty = sum(Picks_table[qty_picked])
Measure = divide([Picked qty],[Case qty])
Measure1 = averagex(values(Item_code[Item_code],[Measure])
The Item_table that I mentioned above is a table with all unique items listed 🙂
With your help,
I could figure out my
Measure 1 = averagex(item_table, [Measure]) (For Average)
Measure 1 = sumx(item_table, [Measure]) (For Sum)
This is what I wanted. Thanks for your help, @Ashish_Mathur
You are welcome.
@gunasai Your sample data may not be covering the issue fully. Here is a measure that works, but you need to check it against more data.
Actual Qty_picked = sumx(Picks_table,divide(Picks_table[Qty_picked],SELECTEDVALUE(item_table[case_qty])))
Thank you for your response!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |