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
Anonymous
Not applicable

Return Slicer's Value (trade simulator)

Hi all,

 

I work with one table (called sTradeSim) that I have created in PowerQuery. It has 3 columns (Fund1, Fund2, Fund3), each having values from -10 to 10, with an increment of 1. Each column has been added to a separate slicer, using an option "Greater than or equal to". The goal of this slicer is for an analyst to be able to simulate trades (selling/buying funds).

justynamk_1-1602586996046.png

Right next to these sliders is a table with the actual funds (Fund1, Fund2, Fund3). I have created a DAX measure that should return the value from each respective slicer, but instead it is always returning the value of the last (3rd) slicer.

justynamk_2-1602587229322.png

 

What I would like to see instead, is: No 1 = -10.00, No 2 = -2.00, No 3 = 3.00. I have tried to find a solution on the forum and combine my SWITCH formula with ALL, ALLEXCEPT, SELECTEDVALUE etc., but it seems like I'm missing something very basic.

mHV_Trades =
SWITCH(
    MAX(FundTable[FundsRanked]),
    1, MIN(sTradeSim[Fund1]),
    2, MIN(sTradeSim[Fund2]),
    3, MIN(sTradeSim[Fund3])
)
 
Thank you for your time,
Justyna


P.S. I intentionally chose not to use What-If analysis as it has a few drawbacks that won't work for our simulator, i.e. it seems to have some rounding issues and size limitations. In our original report, we actually have a wider numeric range (not -10, 10), with an increment of 0.001.

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

Hi @Anonymous ,

 

Please refer to my .pbix file.

.PBIX File 

v-lionel-msft_0-1602743453838.png

 

Best regards,
Lionel Chen

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

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer to my .pbix file.

.PBIX File 

v-lionel-msft_0-1602743453838.png

 

Best regards,
Lionel Chen

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

Anonymous
Not applicable

Thank you Lionel, this is very helpful. It looks like the solution is to create a separate table for each fund, and then have them added to each slicer. This might be quite cumbersome for my company, as we are working with 20-30 funds, but at least it's a working solution - much appreciated.

In the meantime, I'm hoping that Microsoft will work on creating Input Fields - fingers crossed!

Microsoft Ideas 

amitchandak
Super User
Super User

Anonymous
Not applicable

Hi @amitchandak , thank you for your reply and the links, both reports look very useful. However, I am not sure how it can help my question. In my scenario, I created 3 separate slicers, using a single table with 3 columns as a data source. Now, I would like my measure to return the appropriate slicer's value (i.e. for row No 1 return 1st slicer's value, for row No 2 return 2nd slicer's value, etc.), but the SWITCH function that I have created is returning the same value for all 3 rows. I would greatly appreciate your assistance.

 

Edit: I suspect the SWITCH function doesn't work as expected, because all three slicers are coming from the same table. However, I would like to avoid creating a separate table for each slicer, as my original report requires more than 3 slicers. I would also expect these three slicers to not "interact" with each other, as "Edit interactions" mode is off for all three of them.

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.

Top Solution Authors