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
marcp
Helper I
Helper I

Power Query : add column getting value from another one in an another table not related

Hi all

 

I have a table A with one column and one row containing one only value

This value is obtained by a sql query (so it's dynamic one)

 

I have a second table B. I want to add a new column in B which will contains the same value from each row. This value is the one in table A.

 

There is no relation between A and B, so I can't make a join in power query.

 

I guess there is a simple way to do this with the M language but I'm stuck

 

Thank you for your help

 

Regards

Marc

 

 

 

 

 

1 ACCEPTED SOLUTION

Hi Marc,

 

You can do it easily with DAX. If you want the Power Query solution, please refer to the snapshot below.

TableA[DateMax]{0}

Power_Query

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Can you post the sample date and expected table output for easy understanding?

 

Thanks

Raj

Hi here are an example

To start, I have this

Table A
DateMax
14/05/2018

 

Table B 
ReferenceDate
X05/01/2017
Y01/04/2018
Z15/01/2016

 

I need to add the value of DateMax in Table A for each row of Table B like this

Table B  
ReferenceDateDateMax
X05/01/201714/05/2018
Y01/04/201814/05/2018
Z15/01/2016

14/05/2018

 

The ultimate goal is to compute the number of days between the two dates (I know how to do this last part) :

Table B   
ReferenceDateDateMaxDays
X05/01/201714/05/2018495
Y01/04/201814/05/201844
Z15/01/201614/05/2018851

 

Thank you for your help

Regards

Marc

Hi Marc,

 

You can do it easily with DAX. If you want the Power Query solution, please refer to the snapshot below.

TableA[DateMax]{0}

Power_Query

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-jiascu-msft , Kindly explain how I can easly do it in Dax

Hi Dale

 

That's wonderful, exactly what I needed 🙂

A great lesson learned today !

 

Best regards

Marc

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