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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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