Forum Discussion

GenZam1988's avatar
GenZam1988
Frequent Visitor
2 years ago
Solved

Price variation vs other

Hi can you helpme to solve this scenary in PB  I need to compare the variation of product prices, always against the first product. And show in a table like the example below  
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi GenZam1988 ,

    Please try the following methods and check if they can solve your problem:

    1.Create the simple table.

    2.Create the new column to calculate. Drag the column into the table visual and select don’t summarize.

     

    Dif_price = 
    VAR price_1 = SUMX(FILTER('Table', 'Table'[Product] = "Product 1"),'Table'[Price])
    VAR dif_price = (DIVIDE('Table'[Price], price_1) - 1)
    RETURN
        IF(dif_price = 0, BLANK(), dif_price)

     

    3.Select percentage value and one number of decimal.

    4.The result is shown below.

    Best Regards,

    Wisdom Wu

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