Forum Discussion

MalgorzataF's avatar
MalgorzataF
New Member
10 months ago
Solved

MdxScript(Model) (37,5) Calculation error in measure

Hi, I created a measure that is supposed to be used in a slicer. However inserting it in the slicer field, I get the following error: "MdxScript(Model) (37,5) Calculation error in measure. 'table1'[...
  • v-hashadapu's avatar
    10 months ago

    Hi MalgorzataF , Thank you for reaching out to the Microsoft Community Forum.

     

    You’re getting that error because the slicer is based on a field parameter (the Value table), which internally uses a composite key made up of both [Value] and [Value Fields]. Since your measure only references one part of that key ([Value]), the engine throws the error. Instead of using a measure directly in the slicer, create a disconnected table with a single column (for example, Selector[Option]) listing the same options and use SELECTEDVALUE(Selector[Option]) inside your measure to switch logic. Power BI slicers can’t take measures directly, they must be bound to columns.