Forum Discussion

yashwant101's avatar
yashwant101
Icon for Helper III rankHelper III
2 years ago

Dynamic value in Slicer

Hi all,

 

I have a scenario where I need to calculate months till now of different records.

 

In the below case we need to give one more slicer for months till now for each record:

 

The months till now will be calculated based on selection in the date slicer (Transaction Date). Tomake a calculation dynamic we need to create a measure, but we will npt be able to put measure in slicer. While we can put columns in slicers but we cannot make it dynamic. 

 

Please let me know if you have any workaround.

 

Regards,

Yashwant

2 Replies

  • yashwant101 , Based on what I got so far.  You can join the Transaction date with the date of date table

     

    and have measure like

     

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
    last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

     

    You can min date if you need date

     

    minx(DATESMTD('Date'[Date]), Date[Date])

     

     

    • yashwant101's avatar
      yashwant101
      Icon for Helper III rankHelper III

      Hi amitchandak ,

       

      Thanks for your response, but as per my requirement I need to pull the field in a slicer and we cannot pull measure in a slicer.