Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AlexAlberga727
Resolver II
Resolver II

Need to return RELATED value for SKUs with Alternative IDs

Folks - 

 

I have a sistuation were I need to return the total number of Orders for a particular SKU. However - If the SKU has an Alternative SKU, I would like to see the number of orders for the Alternative SKU instead.

 

So far - I have pulled the neccessary data into Power bI, and have set up the relationships accordingly.

 

I have a ProductTable which contains both the SKU, and the Alternative SKU. I wanted to use the RELATED DAX to return the # of Orders - Which works. However, the SKUs that have alternative SKUs return a 0 for # of orders. This is accurate, and as expected. However - because these values have an alternative SKU - Is there a way to lookup to alternative SKUs On PO# instead?

 

Where I get stuck - 

 

QTY on PO = 
  IF( 
    ISBLANK ( PRODUCTTABLE[ALTERNATIVEID ),
     RELATED ( QTYonPO ),


    

 

Im not sure now how to point it to the AlternativeID.

 

Let me know if any ideas are out there, or if any addtional information is needed.

 

Thanks!

 

5 REPLIES 5
AlexAlberga727
Resolver II
Resolver II

2020-02-12_1340.png

 

Here is an example of what I would need. - Where Alternative SKUs ISBLANK - Simply gather the On Po #s using the RELATED DAX. This works with no issue. The problem I have is when Alternative SKU is populated - How can I then tell it to gather the number "On Order" for the Alternative SKU, NOT the SKU,

QTYonPOv2 = 
 IF( ISBLANK( dProductTable[PartID] ),
    RELATED( 'dInvVALUE (Keep Up-to-Date)'[QTY on PO] ),

    LOOKUPVALUE( 'dInvVALUE (Keep Up-to-Date)'[QTY on PO], 'dInvVALUE (Keep Up-to-Date)'[ProductID], dProductTable[PartID] ))

 

I feel this may be to solution - However, I am new to LOOKUPVALUE. Not sure if I have configured it correctly. Results are currenlty are Blank when PARTID is NOT BLANK. It is returning the RELATED values correctly.

 

dInVALUE Table contains the [QTY on PO] #s.

dInvValue[ProductID] is where dProductTable[PartID] can be found.

 

 

 

@amitchandak @az38 @Anonymous @JarroVGIT 

 

Either of you Super Contributors able to assist with this one? Please/Thanks!

Anonymous
Not applicable


Column= if(isblank(max(table[alter id])),ralated(table1[order]),table[order])

Here the logic is ...if alter id is blank then take order from related table else take order from same table.

Incase at first load your alter id is empty...and later you have alter id for particular row then you have to refresh your data..the abouve formula will give you expected result.

I am assunming here table and table 1 is connected.



Thanks
Pravin

Unfortuneatly Im trying to tie in data from a flat file that is updated everyday. This file contains a list of SKUs on a # of Products on Order from the factory. I need to pull this number into my reporting. However, all SKUs are listed in a single column. This column contains both, what we're calling SKUs and Alternative SKUs.

 

Example - SKU "123" has an Alternative SKU "123-Alternative". Both SKUs are found within the same column. However, SKU 123's "On PO" # is 0, whereas 123-Alternative contains 100. The formula I create would need to return 100 for SKU 123, because it contains an alternative SKU.

This needs to ocurr for a couple of SKUs (~10), so i created a table which contains the relationship between SKUs and their Alternative SKU.

 

I have created a couple different calculated columns in data view to make things easier.

 

SKUAlternative SKUQTY on PO
123

123-Alternative

100
123-Alternative 100
456 10
789-Alternative 

100

789789-Alternative

100

 

File which contains the QTY on PO is loaded into its own table, and the table containing the above is linked via ProductID.

 

2020-02-13_0755.png

 

I feel like i need to either use LOOKUPVALUE or... have RELATED point to the alternativeID when gathering QTYonPO opposed to the SKU the record is truley for. 

 

I hope this clears things up, and not make them more complicated/confusing. Please let me know if you have any ideas.

 

Thanks!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.