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

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.

Reply
ajaydavidluke
Helper I
Helper I

Getting a date from one table and into another

Good afternoon all,

 

I want to import a date 'Next Supply Base Prod'[Emb Estimated D] into 'Next Supply Date' table.

 

ajaydavidluke_0-1631705428910.png

ajaydavidluke_1-1631705554862.png

 

I would like then to create a dax based on:

 

if [Expected Delivery Date] is blank then show me [Emb Estimated Delivery Date] else [Expected Delivery Date].

 

Am I asking too much in this instance??

 

Many thanks in advance 🙂

 

 

10 REPLIES 10
Anonymous
Not applicable

Hi,

I have an approach that might work well, but it depends on the following question. Does any Prod/Colour have a single 'Emb Estimated Delivery Date' or 'Expected Delivery Date' associated? If that is the case, you might try this formula. 

Expected/Estimated Delivery Date =
VAR prod_colour = [Prod/Colour]
RETURN
    IF (
        [Expected Delivery Date] = BLANK (),
        CALCULATE (
            SELECTEDVALUE ( 'Next Supply Base Prod'[Emb Estimated Delivery Date] ),
            'Next Supply Base Prod'[Prod/Colour] = prod_colour
        ),
        [Expected Delivery Date]
    )


Regards,

Marc



Hi Marc,  

 

Thank you for your solution:  You can view the results below, I'm definitely closer but I should be expecting to see 'Next supply date' in the 'Expected/Estimated Delivery Date' column where 'Expected Delivery Date' is blank but I'm seeing the opposite to that?

 

ajaydavidluke_0-1631708062193.png

 

Anonymous
Not applicable

Hi,

In which table are you working? I do not see 'Next Supply Date' column in any table. Maybe i have not understood well the problem.

Thanks,

Marc

Hi Marc,

 

Apologies I had renamed the column, i've reveiwed this and have posted the results below, the approach you have suggested has indeed returned a value but not what I was expecting.........The theory should be If 'Expected Delivery Date' is blank then show 'Emb Estimated Delivery Date' else show me the 'Expected Delivery Date'

 

ajaydavidluke_1-1631773737700.png

 

The suggested approach is showing the same value as originally ?

 

In answer to one of your earlier questions Does any Prod/Colour have a single 'Emb Estimated Delivery Date' or 'Expected Delivery Date' associated? Whilst 'Expected Delivery Date' is blank, there are instances where both 'Expected Delivery Date' & 'Emb Estimated Delivery Date' have a value.

 

Anonymous
Not applicable

Hi,

As i can see in the image, the solution is less complex than i thought. Try this DAX, i guess it will work.

Expected/Estimated Delivery Date =
VAR prod_colour = [Prod/Colour]
RETURN
    IF (
        [Expected Delivery Date] = BLANK (),
        [Emb Estimated Delivery Date],
        [Expected Delivery Date]
    )


Regards,

Marc

Hi Marc,

I applied the formula but found it didnt like the Emb Estimated Date:

ajaydavidluke_2-1631781249064.png

 

It doesnt give me the option to select from a different table?

ajaydavidluke_4-1631781500166.png

So I have used SELECTEDVALUE to access the column from another table and have the below:

ajaydavidluke_5-1631781736832.png

However the DAX does not return a value:

ajaydavidluke_6-1631781842202.png

 

I really appriciate your help, my DAX techniques and understanding needs developing as I'm pretty new to Power BI.

 

 

 

 

Anonymous
Not applicable

Hi,

In order to get the correct solution, i need to understand a bit more of the model. Does 'Prod/Colour' column has unique values? I mean, this column does not have any repeated value in 'Next Supply Date' or 'Next Supply Base Prod'.

Thanks,

Marc

Hi Marc,

 

In answer to your question, yes, there may be a value in 'Next Supply Date' which is different to 'Next Supply Base Prod' but in most cases 'Next Supply Date' is blank.  What I am trying to acheive is that once a product has been Emb, it changes to a new product code, therefore when date is blank, I want it to look for a delivery date based on base product not Emb product.

 

Where there is an exisiting value in 'Expected Delivery Date' use that exisiting value, where value is blank, pull in date from 'Emb Estimated Delivery Date'

 

I hope this helps 🙂 

Anonymous
Not applicable

Hi,

Let's do a middle calculation that will help us in this situation. Create a column 'Emb Estimated Delivery Date' in 'Next Supply Date' table. Try with this formula:

Emb Estimated Delivery Date =
VAR prod_colour = [Prod/Colour]
RETURN
 CALCULATE (
            SELECTEDVALUE ( 'Next Supply Base Prod'[Emb Estimated Delivery Date] ),
            'Next Supply Base Prod'[Prod/Colour] = prod_colour
        )


What will this formula do? For any value of Prod/Colour in 'Next Supply Date' it will check if it has a value of 'Emb Estimated Delevery Date' in 'Next Supply Base Prod' and will give it. Confirm if it is working hell.

Regards!

Marc

Hi Marc,

 

I very much appriciate your help,

 

I have created new Column:

ajaydavidluke_3-1631791072820.png

 

I have entered the DAX:

ajaydavidluke_4-1631791096787.png

 

There are lots of blanks in 'Emb Estimated Delivery Date NEW Column' when I would like to be seeing those blanks filled in with the date from 

 

ajaydavidluke_5-1631791160204.png

 

The formula is half working, in that it is detecting a value but it doesnt seem to pull in any date where the value is blank.

 

Many thanks in advance for your time 🙂 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors