powerbicalculationmeasurecardslicers

Power Bi, diference between 2 sliced cards


Power Bi desktop, How can I display in a card the difference between 2 cards which are sliced each one by months?

I have a measure displayed 2 times. Each measure is sliced by 2 different slicers (the slicers are months).

The measurement does not work for the 3rd card, as the two first cards are changing the 3rd one displays 0 or just the result of the initial cards or nothing.


Solution

  • You can only achieve this if the two slicers are from two different tables.

    Let's assume you have two "Month" tables with a column for Month in each, then for your third card, you can use a new Measure similar to:

    Month Diff = 
      var v1 = CALCULATE( [YourMeasure], MIN('Month 1'[Month]) )
      var v2 = CALCULATE( [YourMeasure], MIN('Month 2'[Month]) )
      return v1 - v2
    

    Alternatively, you could have the one slicer with multiselect enabled. Then you can use MIN(...) for the lower value, and MAX(...) for the upper value of the sliced range. You would then need three Measures (one for each card):

    Card 1 = CALCULATE( [YourMeasure], MIN('Month'[Month]) )
    
    Card 2 = CALCULATE( [YourMeasure], MAX('Month'[Month]) )
    
    Card 3 = [Card 1] - [Card 2]