Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Using slicer to change forumla

Hi,

 

i have the following formula:

FY Prior Fcst = calculate(sum(Prior_Forecast[Amount]),Prior_Forecast[Month]= "Nov")/1000
 
i want to add a slicer that allows the user to select a particular month or combination of months. Is there any way to rewrite the formula so it adds the months that have been selected?
  • Hi Anonymous ,

     

    Please try:

    FY Prior Fcst = calculate(sum(Prior_Forecast[Amount]),FILTER('Prior_Forecast',Prior_Forecast[Month] in SELECTCOLUMNS('For slicer',"Month",[Month])))/1000

    Output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Hi Anonymous ,

     

    Beased on your description, I have created a simple sample:

     

    Please try:

    First, create a new table for slicer:

    Then apply the measure:

    FY Prior Fcst = calculate(sum(Prior_Forecast[Amount]),Prior_Forecast[Month]= SELECTEDVALUE('For slicer'[Month]))/1000

    Final output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-jianboli-msft ,

       

      thanks for the help, this does allow me to updated the values automatically based on the month selected however, it does not work if multiple months are selected is there a work around for that?

       

      Thanks,

      Harman

  • Hi Anonymous ,

     

    Please try:

    FY Prior Fcst = calculate(sum(Prior_Forecast[Amount]),FILTER('Prior_Forecast',Prior_Forecast[Month] in SELECTCOLUMNS('For slicer',"Month",[Month])))/1000

    Output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.