I need your help with 2 things (PBIX has been uploaded):
UOM conversions are not totaling correctly
Report is taking way too long and sometimes erroring out when rendering table if I choose all parts
Background on Topic 1:
Units of measure can be entered at the will of the user into our system. For example, someone can enter a sales order for 500 Meters, then another person can enter another Sales order for 735 Feet. This can happen with any data set - Backlog, Inventory, Sales, etc. So I had to devise a way to handle the UOM conversions once the data gets to Power BI. But itâs not ONLY âconvert everything from feet to metersâ or âmeters to feet.â I need to give users a UOM slicer so they can control what UOM they want to convert to.
In Power BI, the default view is to see the Qtyâs in the origional UOM, but the slicer allows them to select the UOM conversion.
My measures work fine (well, not reallyâŚthatâs explained in Topic 2). The PROBLEM is that once the UOMâs are converted, the converted quantities do not add up.
Screen shot below shows how the totals are not correct if I choose to convert everything thatâs NOT feet to feet.
I need help with optimizing the conversion measures. Other than the totaling issue mentioned above, they work IF I select one part. As soon as I clear the Mil Spec filter, the table will not render. I ran the Performance Analyzer, but the Sales Detail table takes many, many minutes to render (if it renders at all). So there is an obvious problem in the conversion measures. I do not know enough about how to read the queries that the Performance Analyzer puts out. Backlog and Inventory do take a little bit of time, but nothing like Sales.
I would greatly appreciate it if someone could run the Performance Analyzer on the attached PBIX and tell me what Iâm doing wrong with the conversion measures.
Hi @Rose
Thanks you very much for posting your query into the forum.
I see that the Item Master table contains 2,074,547 rows. In the actual data source, if you just use the AEP_ITEM_CODE that are present in the Shipments, Inventory and Backlog tables, would the number of rows in this table be reduced?
Item Master New =
VAR _Item_Shipments = VALUES( Shipments[AEP_ITEM_CODE])
VAR _Item_Inventory = VALUES( Inventory[AEP_ITEM_CODE])
VAR _Item_Backlog = VALUES( Backlog[AEP_ITEM_CODE])
VAR _Union_Items = UNION( _Item_Shipments, _Item_Inventory, _Item_Backlog )
VAR _Result = FILTER( 'Item Master', [AEP_ITEM_CODE] IN _Union_Items )
RETURN _Result
Thatâs a very interesting way of paring down the Item Master dataset. The Item Master New takes it from over 2 million rows to roughly 135k. Iâm definitely going to use that logic in this and other reports.
Unfortunately, that doesnât solve my main problem of the table taking too long to render when all parts are selected.
The more I research this, the more Iâm thinking that the answer is to create a virtual table that contains Customer Name, Part Number, the converted UOM and the results of the UOM conversion. I also think that would solve my problem of the table not totaling correctly.
If anyone can help me with this, Iâd greatly appreciate it!
Hi @Rose,
It would be convenient to generate the Item Master New table from Power Query and thus reduce its records to only those that are being used in the 3 fact tables.
On the other hand, I have created the following measures in the JAFP Measures folder:
Total Sales Qty_JAFP = SUM( Shipments[TRANSACTION_QTY] )
I have substituted SUMX for SUM, since SUMX being an iterator performs the calculations row by row and is less efficient than the SUM aggregation function.
I was very hopeful that your new measures were going to solve the problem, but they havenât.
The table will not render at all UNLESS I select a part number (or a few part numbers). This is a problem because users need to see ALL parts for a customer or group of customers. Even if I filter by a Customer, as soon as I clear the Mil Spec filter, the table takes forever to render eventually resulting in this message:
The sample PBIX file you sent me only seems to work because the data set is small. As soon as I imported the full data sets into your PBIX, it doesnât work.
Unfortunately, I canât upload my full file. Itâs too big.
Hello @Rose , did the response above help solve your query? Itâs been a while since we got a response from you. In case there wonât be any activity on it in the next few days, weâll be tagging this post as Solved.
Hello @Rose . Due to the length by which this post has been active, we are tagging it as Solved. Thanks to the contributors of this post. For further questions related to this post, please make a new thread. Feel free to reopen this thread if you anyone would like to answer the pending inquiry above.
I tried your measures that âcorrect the totalsâ and they work beautifully if the tables contain both Customer Name and Mil Spec parts data (Shipments, Forecast, and Backlog data files all contain Customer data AND Mil Spec data). But it stops working when Iâm trying to create a UOM conversion measure for tables that donât have any customer data - for example Inventory and Open POâs.
I tried a few different things including removing the Crossjoin and just create a virtual table with the Mil Spec and the interim converted Qty, but it doesnât work. Hereâs the example of the measure you gave me that works for tables that contain both Customer and Mil Spec data:
Hi @Rose,
In the case of the Inventory table we are showing values of Inventory[UNIT_OF_MEASURE] and âItem Master Newâ[AEP_ITEM_CODE].
You can modify the Converted Inventory Qty_JAFP Totals measure to create the virtual table as follows: