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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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