Forum Discussion

roundbunny's avatar
roundbunny
Frequent Visitor
2 years ago
Solved

calculating differences between rows when using 4 slicers

Hi everyone, I'd like to calculate differences for PRICE when using multiple slicers.   I would like to compare PRICE within the same PRODUCT/STATE/YEAR/SIZE.  (In my dataset, I have one unique row ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi roundbunny ,

    The Table data is shown below:

    Please follow these steps:
    1. Use the following DAX expression to create a measure named ‘Price difference’

    Price difference = 
    VAR _a = MIN('Table'[PRICE])
    VAR _b = MAX('Table'[PRICE])
    RETURN _b - _a
    

    2. Fianl output

     

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