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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TacoTime
Frequent Visitor

Card Comparison Page with Slicers

Hello-

 

I am trying to create an comparison page with financial data that users can select and compare 2 stores/areas/regions. The values are currently calculated (like the 35.13M) using a switch dax that changes based on what period/year is selected on the right side of the page and also whatever store/region/area is selected above them (currently using "edit interactions" for the values to update).

 

Is there a way to have an arrow appear based on which card value is larger when different store slicers are selected? essentially trying to compare card values and highlight the larger one. Since the values are all influenced by multiple tables/slicers, I don't know if it is possible.

 

The switch measure for the 35.13M is shown below with also a "filter on this visual" filter on it so it shows revenue and not all transactions.

 

Total Switch =

SWITCH(
SELECTEDVALUE('Period Selection'[Period Selection]),
"PTD",[PTD],
"YTD",[YTD],
"13 Periods",[P_13]
)

 

pbi example.PNG

 

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @TacoTime ,

The same field, the same measure cannot display different selected values.

You can create a calculation table (which contains the Store column), create a measure to display the value selected by Store in the calculation table.

This will form a measure showing the value selected by the Store of Table1, and another measure showing the value selected by the Store of Table2 to achieve a comparison effect.

I created some data:

vyangliumsft_0-1636599039544.png

Here are the steps you can follow:

1. Create calculated table.

Tabel_Store2 = SUMMARIZE('Table','Table'[Store])

vyangliumsft_1-1636599039547.png

2. Create measure.

Measure _Store1 =
var _selectyear=SELECTEDVALUE('Table'[year])
var _selectstore=SELECTEDVALUE('Table'[Store])
return
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[year]=_selectyear&&'Table'[Store]=_selectstore))
Measure—_Store2 =
var _selectyear=SELECTEDVALUE('Table'[year])
var _selectstore=SELECTEDVALUE('Tabel_Store2'[Store])
return
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[year]=_selectyear&&'Table'[Store]=_selectstore))

3. Create slicers using [year], [Store] of Table and [Store] of Tabel_Store2 respectively.

4. Result:

The two Measure display the values selected by different Stores

vyangliumsft_2-1636599039550.png

 

Best Regards,

Liu Yang

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

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @TacoTime ,

The same field, the same measure cannot display different selected values.

You can create a calculation table (which contains the Store column), create a measure to display the value selected by Store in the calculation table.

This will form a measure showing the value selected by the Store of Table1, and another measure showing the value selected by the Store of Table2 to achieve a comparison effect.

I created some data:

vyangliumsft_0-1636599039544.png

Here are the steps you can follow:

1. Create calculated table.

Tabel_Store2 = SUMMARIZE('Table','Table'[Store])

vyangliumsft_1-1636599039547.png

2. Create measure.

Measure _Store1 =
var _selectyear=SELECTEDVALUE('Table'[year])
var _selectstore=SELECTEDVALUE('Table'[Store])
return
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[year]=_selectyear&&'Table'[Store]=_selectstore))
Measure—_Store2 =
var _selectyear=SELECTEDVALUE('Table'[year])
var _selectstore=SELECTEDVALUE('Tabel_Store2'[Store])
return
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[year]=_selectyear&&'Table'[Store]=_selectstore))

3. Create slicers using [year], [Store] of Table and [Store] of Tabel_Store2 respectively.

4. Result:

The two Measure display the values selected by different Stores

vyangliumsft_2-1636599039550.png

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@TacoTime , if you need to use two slicer values to compare. One set should be independent slicer 

 

How to use two Date/Period slicers:https://www.youtube.com/watch?v=WSeZr_-MiTg

if needed

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

How Interactions Work- Split Page using interactions to compare: https://youtu.be/GIfRKzhMaR4

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.