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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Fill with same value based on index column or minimize table to one column

Hi everyone, 

 

I am trying to solve the following problem where I have a table similar to the following one (in Power Query Editor):

MrSoter_0-1667493668486.png

I would like to get two of the following result but I don't know how to get it:

MrSoter_1-1667493845493.pngMrSoter_2-1667493878892.png

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Create new table:

Table 2 = 
SELECTCOLUMNS (
    'Table',
    "UID", 'Table'[UID],
    "Date1",
        CALCULATE (
            MAX ( 'Table'[DATA1] ),
            FILTER ( 'Table', 'Table'[UID] = EARLIER ( 'Table'[UID] ) )
        ),
    "Date2",
        CALCULATE (
            MAX ( 'Table'[DATA2] ),
            FILTER ( 'Table', 'Table'[UID] = EARLIER ( 'Table'[UID] ) )
        ),
    "Date3",
        CALCULATE (
            MAX ( 'Table'[DATA3] ),
            FILTER ( 'Table', 'Table'[UID] = EARLIER ( 'Table'[UID] ) )
        )
)

vluwangmsft_0-1667550960345.png

 

Table 3 = DISTINCT('Table 2')

vluwangmsft_1-1667550987160.png

 

 

Best Regards

Lucien

View solution in original post

1 REPLY 1
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Create new table:

Table 2 = 
SELECTCOLUMNS (
    'Table',
    "UID", 'Table'[UID],
    "Date1",
        CALCULATE (
            MAX ( 'Table'[DATA1] ),
            FILTER ( 'Table', 'Table'[UID] = EARLIER ( 'Table'[UID] ) )
        ),
    "Date2",
        CALCULATE (
            MAX ( 'Table'[DATA2] ),
            FILTER ( 'Table', 'Table'[UID] = EARLIER ( 'Table'[UID] ) )
        ),
    "Date3",
        CALCULATE (
            MAX ( 'Table'[DATA3] ),
            FILTER ( 'Table', 'Table'[UID] = EARLIER ( 'Table'[UID] ) )
        )
)

vluwangmsft_0-1667550960345.png

 

Table 3 = DISTINCT('Table 2')

vluwangmsft_1-1667550987160.png

 

 

Best Regards

Lucien

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors