Forum Discussion

CeeJayC's avatar
CeeJayC
New Member
8 months ago
Solved

Creating a dynamic filtered table variable

Hello! I'm hoping there is a simple DAX misunderstanding on my part here. My underlying sales data ("Data") has two forecast bases, named FCST1 and FCST2. I want my users to be able to use a slicer o...
  • v-hjannapu's avatar
    v-hjannapu
    8 months ago

    Hi CeeJayC,
    Thank you for your patience . The issue is that SWITCH and IF in DAX only return scalar values, not tables, which caused the parameter is not the correct type error in your earlier attempts.

     

    To resolve this, you need to adjust the logic to switch between complete calculations, such as the results from SUMX, rather than switching between tables.

     

    SWITCH works in this context because it produces scalar values from each SUMX calculation. Each branch uses its own FILTER, so the slicer selection still manages the filtering logic. This approach avoids both the type mismatch error and the “multiple columns cannot be converted to scalar” issue.

     

    Please give it a try and let us know how it goes.

    Regards,
    Community Support Team.