Forum Discussion
Anonymous
6 years agoNot applicable
Switch Selected Value Errors
I am attempting to create a Slicer to toggle between the current values and the day over day change. The Date Rank column ranks the days from 1 (most recent) descending. The curr_date variable I...
- 6 years ago
Anonymous here is the measure provided as solution by email.
Selected Value = var curr_date_rank = min(Sheet3[Date Rank]) var prev_date_rank = (Min(Sheet3[Date Rank]) + 1) var switchvalue = SWITCH( SELECTEDVALUE(Query1[ID]), 1, calculate(sum(Sheet3[Delta]), Sheet3[Date Rank] = curr_date_rank)/10000 , 2, calculate(sum(Sheet3[Delta]), Sheet3[Date Rank] = curr_date_rank)/10000 - calculate(SUM(Sheet3[Delta]), ALL(Sheet3[Date]) ,Sheet3[Date Rank] = prev_date_rank)/10000, 0) return switchvalue
v-kelly-msft
6 years agoCommunity Support
Hi Anonymous ,
Can you upload your .pbix file to onedrive business and share the link with me?
Best Regards,
Kelly
Kelly
Did I answer your question? Mark my post as a solution!
parry2k
6 years agoSuper User
Anonymous here is the measure provided as solution by email.
Selected Value =
var curr_date_rank = min(Sheet3[Date Rank])
var prev_date_rank = (Min(Sheet3[Date Rank]) + 1)
var switchvalue =
SWITCH( SELECTEDVALUE(Query1[ID]),
1, calculate(sum(Sheet3[Delta]), Sheet3[Date Rank] = curr_date_rank)/10000 ,
2, calculate(sum(Sheet3[Delta]), Sheet3[Date Rank] = curr_date_rank)/10000 - calculate(SUM(Sheet3[Delta]), ALL(Sheet3[Date]) ,Sheet3[Date Rank] = prev_date_rank)/10000, 0)
return
switchvalue