Forum Discussion
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
- JohnCavilHelper I
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.
- v-chuncz-msftCommunity Support
Here is a similar case for your reference.
- JohnCavilHelper I
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] )RETURNCALCULATE ( 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 🙂