Forum Discussion

tfraletti's avatar
tfraletti
Icon for Helper I rankHelper I
6 years ago
Solved

How to use a selected date value to filter a data table?

Hello,   My challenge is: My customer have a Year-Month filter which allows him to select only one period that he wants to see the data. All the visuals should show data only from this selected per...
  • jdbuchanan71's avatar
    jdbuchanan71
    6 years ago

    tfraletti 

    My question was more about the axis and it is what I feared that you have a date component as the chart axis.  The only way I know of to get that to work is to combine a measure like I wrote with a secondary date table.  In this example I have created a copy of the date table with this code.

     

    Dates2 = 'Date'

     

    The slicer is from the primary date table.  The  Month column in the chart and grid are from the second date table and you can see that the [Last 6 months] measure returns correctly.  Having the secondary date table allows the [month] column in the visual to not be filtered buy the section made on the main date table.  Then the measure handles only returning data for those 6 months and it aligns correctly.

    You need to join the secondary date table into your model the same way the primary date table is joined in.