Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JohnCavil
Helper I
Helper I

Compare Card Values

I want to compare the values of two different cards that measure the same field but with two different dates.

 

So one card is affected by Date Slider X, and the other by Date Slider Y, but both are looking at the same field. I wish to create a field that measures the difference between the values of these two cards.

 

My end goal is just to have one of the cards act as a benchmark, so that someone can compare the value from the current month with the previous month (or whatever date range they choose). Based on that comparison i want to display certain visuals/colors on my page. I don't know if theres another easier way to do this, as i am new to Power BI.

 

Is it possible to do this?

 

Thanks in advance 🙂

 

6 REPLIES 6
v-chuncz-msft
Community Support
Community Support

@JohnCavil 

 

Here is a similar case for your reference.

https://community.powerbi.com/t5/Desktop/Plot-difference-between-two-rows-based-on-slicer-selection/...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey thanks for the reply, i think i'm getting close to what i want. 

 

Based on the example in your link i now have this code for the measure 

 

Measure =
VAR vdate =
SELECTEDVALUE ( 'Complete Data'[date] )
RETURN
CALCULATE ( SELECTEDVALUE ( 'Benchmark Data'[impressions] ); 'Benchmark Data'[date] = vdate )
- SELECTEDVALUE ( 'Benchmark Data'[impressions] )
 
However the issue is that i cannot get a SELECTEDVALUE out from my slicer (as there isn't a single value selected, but a range).
 
But i think it could work if i use two tables that are copies of eachother, i just need to be able to get the selected value from the date slicer, or somehow just get the selected values of my "impression" field (based on the date selected). Basically i just need to know how to use the example you linked, but with a date slicer instead of a simple selection.
 
Hope i make sense. Thanks for your time 🙂
Mariusz
Community Champion
Community Champion

Hi @JohnCavil 

 

You can create a measure that compares these Card Visual Measures.

diff = [Card1Measure] - [Card1Measure]

Later you can use it for conditional formatting to change the colours.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

 

 

Sorry if i misunderstand something, but how do i get the values of the cards, and not the measure that the cards refer to?

 

In this case both cards refer to the same "Impression" field. But each card is affected by two different Date Slicers (so they show two different values). Are you saying it's possible to get the values of the cards themselves, and not the field they're referring to?

 

I understand i can create a measure that compares two other fields/measures, but in this case i want to create a measure that compares the same field but with two different filters (chosen in the two date slicers).

 

Essentially i want to compare impressions from date x-y with impressions from date y-z, with the dates being chosen by the user in a slicer. And then store that value as a measure or whatever.

 

I'm sorry if i'm misunderstanding something or just repeating myself, but i cant seem to create a measure that does this.

 

Thank you.

 

 

Hi @JohnCavil 

 

You can not refer to values displayed in the card directly, but you can create a measure that mimics that behaviour.

 

How did you use "Edit Interactions" to adjust cards responsiveness to slicers?

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

 

Hey Mariusz

 

I simply selected each slicer, and used "edit interactions" to make sure that slicer 1 didnt affect card 2, and slicer 2 didnt affect card 1. Just by selecting "none" over the visual.

 

So now i have two slicers with two different date ranges, and two cards that point at the same field but each have a different value as they are being sliced by two separate date ranges (slicer 1 and 2).

 

You are saying i can mimic this behavior in a measure so that i get the value of each card according to the date selected in each slicer?

 

Thank you 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.