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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
estewart
New Member

Lookup values (or other method?) from same table

I am trying to create a new column that assigns trend "start date" to trend "data value". See table below. Columns in gray are what I have currently. Col A has two variable types "Trend_x" which is the data value and Trend_x_Start" which is the start date. YearQuarter represents different quarterly forecasts. Value contains either the data value or the trend start date (e.g. YYYY.Q format).

 

Trend start date is not consistent across all (a) Trend_x and (b) YearQuarter combinations.

 

I am trying to create the column in green at the query or table level using DAX. So far I haven't been able to get it to work.

 

Any help is appreciated. Thank you.

 

Capture.PNG

 

 

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @estewart ,

 

Sorry for the delay.

 

For your sceanrio, you could try the steps below.

 

1. Go to Query editor and duplicate the original table and filter rows with Variable.

 

filter rows.PNG

 

2. Apply and Close , create a calcualted column in table 2 with the formula below.

 

 

Column = IF('Table2'[Variable] = "Trend_1_Start",1,2)

3.  Create two calculated columns in Table.

 

Column = IF('Table1'[Variable] in {"Trend_1","Trend_1_Start"},1,2)
Column 2 =
LOOKUPVALUE (
    'Table2'[Value],
    'Table2'[YearQuarter], 'Table1'[YearQuarter],
    Table2[Column], 'Table1'[Column]
)

Here is the output.

 

Capture.PNG

 

More details please refer to my attachment.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
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

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @estewart ,

 

Sorry for the delay.

 

For your sceanrio, you could try the steps below.

 

1. Go to Query editor and duplicate the original table and filter rows with Variable.

 

filter rows.PNG

 

2. Apply and Close , create a calcualted column in table 2 with the formula below.

 

 

Column = IF('Table2'[Variable] = "Trend_1_Start",1,2)

3.  Create two calculated columns in Table.

 

Column = IF('Table1'[Variable] in {"Trend_1","Trend_1_Start"},1,2)
Column 2 =
LOOKUPVALUE (
    'Table2'[Value],
    'Table2'[YearQuarter], 'Table1'[YearQuarter],
    Table2[Column], 'Table1'[Column]
)

Here is the output.

 

Capture.PNG

 

More details please refer to my attachment.

 

Best  Regards,

Cherry

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.