Forum Discussion

LasseMr's avatar
LasseMr
Advocate II
4 years ago

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:

ABC From Parameter =
SWITCH(TRUE(),
[Running Total %]<=[A Value],"A",
[Running Total %]<=[C Value],"B",
[Running Total %]>[C Value],"C"
)

 

 

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

  • 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