Forum Discussion
Getting Model Parameter to work with Switch in Calculated Column (classic ABC case)
Dear community,
Does anyone know why a selectedvalue() from a model parameter approach does not work well in a calculated column using the switch case approach?
ABC From Parameter shows incorrectly C in all rows whereas when I use a fixed measure value it is able to classify A, B, C correctly.
Switch case:
I have uploaded the sample PBIX to this shared link: https://dbizdk-my.sharepoint.com/:u:/g/personal/lasse_dbiz_dk/EYfQ7Lshf1FAvN71loHD7y4B5k5sJRVsWE6-LLDy5FVTXw?e=dgJuxQ
Curious to understand this better!
Thanks a lot!
8 Replies
- amitchandakSuper User
LasseMr , to work with slicer you need measure
example
ABC From Parameter m = SWITCH(TRUE(), min([Running Total %])<=[A Value],"A", min([Running Total %])<=[C Value],"B", min([Running Total %])>[C Value],"C" )Also running total should be a measure
- LasseMrAdvocate II
amitchandak , thank you for the quick support.
Tried to follow your recommendations:
- added a Running Total % Measure as a Measure instead of Calc Column.
- added a ABC classification with reference to Measure instead of Calc Column, I can't add a min() around them though as they are of type measure and not column now.
As you can see on the result, the Running Total % Measure still shows correct % per item, but the ABC From Parameter Amit still doesn't work correctly.
Any ideas?
PBIX sample file updated here: https://dbizdk-my.sharepoint.com/:u:/g/personal/lasse_dbiz_dk/EYfQ7Lshf1FAvN71loHD7y4B5k5sJRVsWE6-LLDy5FVTXw?e=8ssZaj
- amitchandakSuper User
LasseMr , everything is correct. The column with my name needs to be a measure 😆.
Just create that as a measure, the one you have shown in the screenshot. File attached after signature