Forum Discussion

frostys's avatar
frostys
Icon for Helper I rankHelper I
8 years ago

Change a value by a variable in measure

Hi everyone,

 

I try change this value ("3") by a variable :  

 

 

 EOMONTH('Data input'[Date],3)>TODAY()

I want to choose with a slicer the number of month. I have created a new table "Time slicer" which column is 1,3,6,9,12.

 

 

And "Selected time" who keep the values selected by the slicer "time slicer"

 

Selected time = VALUES('Time slicer'[Time slicer])

 

But when I change "3" By my new measure :

 

 EOMONTH('Data input'[Date],[Selected time])>TODAY()

The visualisation don't work anymore 

 

 

Thank you for your help !

 

 

 

16 Replies

    • frostys's avatar
      frostys
      Icon for Helper I rankHelper I

      Hi Ashish_Mathur,

       

      The visualization is now working but with just the value "1".

      When I select other values (ex:3,6,9,12)  in the slicer the visual keep "1" as month

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

         

        That is due to something else then.  Share the link from where i can download your file.  Expain the business problem and show the expected result.

  • Hi frostys,

    Try using the below code

     

     

    EOMONTH('Data input'[Date],SELECTEDVALUE('Time slicer'[Time slicer])>TODAY()

     

    Here the

    SELECTEDVALUE('Time slicer'[Time slicer])

    will hold the value of the selection that you make in the slicer 

    • frostys's avatar
      frostys
      Icon for Helper I rankHelper I

      Hi Thejeswar,

       

      This syntax is incorrect ,

       

       

       

      I think it expect a alternate result but I don't find the correct syntax

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi frostys,

     

    Did you solve it? Can you share the answer or mark the proper answer as a solution please?

     

    Best Regards,
    Dale

      • v-jiascu-msft's avatar
        v-jiascu-msft
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi frostys,

         

        Isn't that formula a solution even if it can work? Can you share a dummy file? To be honest, your scenario isn't  complicated.

         

        Best Regards,

        Dale