DAX – Calculating the difference between 2 selections on a Slicer
Once again, I really enjoy answering questions on the Power BI Community, it keeps me challenged on how to find solutions to people’s requirements.
This time the challenge was that a user on the forum was looking to calculate the difference between 2 selections made on a slicer. In this example the slicer was on a Product.
Below is the example that I was sent
I was certain that I could get this done by using a DAX measure.
I was able to get this done by using the following measure below. Not only that I created it in a way that I could select 2 products from a single slicer which would then give me the result I was looking for.
Based on the above example the result I was looking for is 63.
Below is the selection that I had on the single Product Slicer
Here is the DAX measure with an explanation below.