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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

how do i auto populate columns with specific date

i have a data set grouped in to rows of 7

each group of 7 are connected by a unique id number

each row is a specific question

there is a comments box that provides the answer

 

i have created calculated columns to extrapolate the answer for each

                                                                            tax         invoice     date

number 112            question 1 tax                    answer1    blank     blank

number 112            question 2 invoice              blank       answer2  blank

number 112            question 3  date                 blank       blank       answer3

number 113            question 1  tax                   answer     blank       blank

number 113            question 2 invoice              blank       answer    blank

number 113            question 3 date                  blank       blank       answer

 

is it possible to auto populate the cells for each column with the answer for each unique number id?

                                                                              tax            invoice     date

number 112            question 1  Tax                   answer 1    answer2  answer 3

number 112            question 2   Invoice            answer 1    answer2  answer 3

number 112            question 3   Date                answer 1    answer2  answer 3

number 113            question 1   Tax                  answer 1    answer2  answer 3

number 113            question 2   Invoice            answer 1    answer2  answer 3

number 113            question 3   Date                answer 1    answer2  answer 3

 

i am never really used Power Bi and i am learning as i go

 

any help would be appreciated 😊

5 REPLIES 5
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description and sample data, I think you can achieve the expected data using the “replace values” in the Power Query, like this:

You can do the operation for each of the three columns:

v-robertq-msft_0-1615530081971.png

 

And you can get what you want, like this:

v-robertq-msft_1-1615530081976.png

 

This is the M code in the advanced editor, which you can copy and paste into yours:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyivNTUotUjA0NFLSUVIoLE0tLsnMz1MwBPJKEiuAZGJecXlqEYgPQrE6OLWAeJl5ZfmZyakQxRCdRgS0GQN5KYklUD1wbcaoeoxJd50xea4zJtJ1sQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [number = _t, question = _t, name = _t, Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"number", type text}, {"question", type text}, {"name", type text}, {"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","","answer1",Replacer.ReplaceValue,{"Column1"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","","answer2",Replacer.ReplaceValue,{"Column2"}),
    #"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","","answer3",Replacer.ReplaceValue,{"Column3"})
in
    #"Replaced Value2"

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

Anonymous
Not applicable

hi @v-robertq-msft 

 

as below the table as it would probably appear

 

Invoicing test 1.png

Anonymous
Not applicable

Hi  @v-robertq-msft 

 

i think the problem i have is this that the answers to any of the 7 questions  will almost always be different for each unique ID

so answer 1 for unique ID 112 will be different to answer 1 for unique ID 113

 

Power Bi would need to be able to

 

  • reference the unique ID before populating a cell, knowing to only go down 6 ( i cell will already have the answer to copy ) cells before the next unique ID is reached

i feel this may be too complex a query to solve in power bi or the data must be maniuplated prior to being uploaded

 

also forgot to mention currently my data source is an excel sheet

 

Invoicing test.png

Anonymous
Not applicable

Hi @v-robertq-msft 

 

thank you for the code

 

i will try this with my data today and see if it works

 

i will report back if it does or post some sample data if it doesnt

 

thank you again!!

Anonymous
Not applicable

Forgot to mention the reason i am asking is when i display this data in table format i am limited to what i can filter because some data will appear against the unique ID and the rest appears against blank

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.