Forum Discussion

sam_hoccane's avatar
sam_hoccane
Icon for Helper I rankHelper I
4 years ago
Solved

adding new rows in table with condition

Hello Community,  I am new user to Power BI. Can you please help me with following problem: I have following table where three rows needs to added.  So after May 22, I would like to add three more ...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi sam_hoccane ,

    According to your description, I create a sample.

    Here's my solution.

    1.Create a new table. Make relationship with the two tables, the Year Month column in the two tables both should be of date type.

    2.Create a measure.

    Measure Value =
    IF (
        MAX ( 'Table'[Value] ) <> BLANK (),
        MAX ( 'Table'[Value] ),
        MAXX (
            FILTER (
                ALL ( 'Table' ),
                'Table'[Year Month ] = MAXX ( ALL ( 'Table' ), 'Table'[Year Month ] )
            ),
            'Table'[Value]
        )
            * POWER (
                1.2,
                DATEDIFF (
                    MAXX ( ALL ( 'Table' ), 'Table'[Year Month ] ),
                    MAX ( 'Table (2)'[Year Month] ),
                    MONTH
                )
            )
    )
    

    Get the result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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