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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Frnztt
New Member

Repeat value from previous line (Language M)

Good afternoon everyone, I need help bringing information from my previous line, I will describe here what I am doing.

 

Based on the table below:

Frnztt_0-1702927759083.png

From this table I need to add another column named "Recurso" where I must put the name that comes before the dates.

Use the formula below to find the name:

= Table.AddColumn(#"Inserção de Coluna Index", "Recurso", each
let
CurrentData = [Data],
PreviousData = if [Index] > 0 then {[Index]-1}[Recurso] else null
in
if Text.Contains(CurrentData, "/") then PreviousData else CurrentData
)

 

What I'm not able to solve is copying the information from the previous line "Recurso" and rewriting it in the "Recurso" column when my column is a date, below is the image of the result obtained:

Frnztt_1-1702928079518.png

 

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Do you mean you want to get the name for each section on the same row as the date?

--

I think the code provided can be simplified:

if Text.Contains([Data], "/") then null else [Data])

then do a Fill.Down on the column

View solution in original post

3 REPLIES 3
HotChilli
Super User
Super User

Do you mean you want to get the name for each section on the same row as the date?

--

I think the code provided can be simplified:

if Text.Contains([Data], "/") then null else [Data])

then do a Fill.Down on the column

You're right, I didn't understand at first, setting everything to null I can do the filldown later.
Thank you very much.

What I need is that when it doesn't identify the "/" of the date, it retrieves the information from the previous line that I'm filling in.
Example, if you don't find "/" take the name information and write it in "Recurso", if you don't find "/" return the name placed on the previous line of "Recurso"

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors