cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
justynamk
Advocate I
Advocate I

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 @justynamk ,

 

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 @justynamk ,

 

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

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 IV
Super User IV

@justynamk , Actually, you can generateseries and use that in slicer.

I used a similar slicer in EMI calculator in place of What if

https://community.powerbi.com/t5/Quick-Measures-Gallery/PMT-Monthly-EMI-Calculator/td-p/1232245
https://community.powerbi.com/t5/Quick-Measures-Gallery/Financial-Magic-to-continue-with-10-Recently...

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors