Forum Discussion

jerryhpe_Bi's avatar
jerryhpe_Bi
New Member
8 years ago
Solved

Replicate excel table on power bi

Hi Team,   I am trying to replicate a table that is under an excel file its something like this:               Last     Current data 1  325         77 data 2  3199      1242 data 3  3149      ...
  • v-yulgu-msft's avatar
    v-yulgu-msft
    8 years ago

    Hi jerryhpe_Bi,

     

     

    It is not possible to add percentage values under the "Sales" rows as shown above. As a workaround, we could create measures to calculate "compare month", add it to Matirx, extra columns would be displayed, like below:

     

    Sample data.

     

    Measure:

    difference% =
    VAR PreviousSales =
        CALCULATE (
            SUM ( Table7[Sales] ),
            FILTER (
                ALL ( Table7 ),
                Table7[Category] = SELECTEDVALUE ( Table7[Category] )
                    && Table7[MonthNo]
                        = MAX ( Table7[MonthNo] ) - 1
            )
        )
    VAR CurrentSales =
        SUM ( Table7[Sales] )
    RETURN
        IF (
            ISBLANK ( PreviousSales ),
            BLANK (),
            ( PreviousSales - CurrentSales )
                / CurrentSales
        )
    

    Best regards,

    Yuliana Gu