Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

What if Parameter not refreshing

Hi All, 

 

I have 2 tables containing years' data. 

I want to create a slicer that would filter the 2 tables at once. 

I created a "what if Parameter" with a default value. And a condition (a simple IF function) in each table, to check if the year in each line of the 2 tables matches the selected year. 

It doesn't work because when I select a year, the calculation (the condition in each table) uses the default value from the parameter rather than the one selected. 

Any idea why, please?

Thanks

JL

  • Hi, Anonymous 

     

    The value of the calculated column won't change as the slicer changes.

    You can create a measure instead of column.

    Like this:

     

    Measure = IF(SELECTEDVALUE('Table'[year])=SELECTEDVALUE(Parameter[Parameter]),1,0)

     

    Did I answer your question ? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.


    Best Regards,
    Community Support Team _ Janey

5 Replies

  • Anonymous ,

    are you creating a measure like 

    calculate(**bleep**(Table1[Value]), filter(Table1, Table1[Year] = [what if Value]))

     

    if not try above.

     

    Slicer do work with columns, if you are trying one

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      My formula is:

      SELECTED YEAR = if('PurchaseOrders_GL connection'[RECEIVED FY]='SELECTED YEAR'[SELECTED YEAR Value],1,0)
       
      I tried this as per your proposal (for my second table):
      SELECTED YEAR = CALCULATE(1,filter(KeyTasks,KeyTasks[FY Key TASK]='SELECTED YEAR'[SELECTED YEAR Value]))
       
      None of the 2 works. 
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, 

    I have done a few trials, but it seems the Selected Year Value always uses the default value rather than the one selected in the slicer. I checked the Selected year value, and it equals the one from the slicer...

     

    • v-janeyg-msft's avatar
      v-janeyg-msft
      Icon for Community Support rankCommunity Support

      Hi, Anonymous 

       

      The value of the calculated column won't change as the slicer changes.

      You can create a measure instead of column.

      Like this:

       

      Measure = IF(SELECTEDVALUE('Table'[year])=SELECTEDVALUE(Parameter[Parameter]),1,0)

       

      Did I answer your question ? Please mark my reply as solution. Thank you very much.
      If not, please feel free to ask me.


      Best Regards,
      Community Support Team _ Janey

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks heaps 🙂