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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ffiore
Regular Visitor

Get a value from a table

Hi,

in power query, i didn't find how to do this.

I've a tableA from excel like this:

ffiore_0-1714122782720.png

 

given a Date e.g. 1980/01/15 I'd like to retrieve the value in the table - from the year (so i select the row in the table) and the month (so i select the column) of the Date. the retrieved value should be put in a new column of another table
I've tried something like this:  = Table.AddColumn (#"PreviousTable", "NewColumn", Record.Field(Table.SelectRows(#"tableA", each [Anno] = YEAR[DATE]){0}, MONTH[Date]))

but does not work

thanks for your help

Francesco

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

hello, @ffiore , try 

Record.FieldValues(
    Table.SelectRows(
        #"tableA", 
        each [Anno] = YEAR[DATE]
    ){0}
){MONTH[Date]}

View solution in original post

2 REPLIES 2
ffiorellino
Frequent Visitor

ok: Record.FieldValues helped me a lot.

(Date.Year and Date.Month are those in Power Query)

@AlienSx  many thanks

AlienSx
Super User
Super User

hello, @ffiore , try 

Record.FieldValues(
    Table.SelectRows(
        #"tableA", 
        each [Anno] = YEAR[DATE]
    ){0}
){MONTH[Date]}

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors