Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Display data for previous 6 months

Hello, I have a fact table and a dimension date table related with each other through the date columns (Date - Created_On). I have to filter the month in slicer and to display the number of applicat...
  • amitchandak's avatar
    4 years ago

    Anonymous , If you want to select a month and want to show more than that on the axis/row, the slicer needs to be on an independent date table

     

    //Date1 is independent Date table, Date is joined with Table
    new measure =
    var _max = maxx(allselected(Date1),Date1[Date])
    var _min = eomonth(_max, -6) +1
    return
    calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

     

    Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

  • Anonymous's avatar
    Anonymous
    4 years ago

    HI amitchandak 
    It helped me a lot a formula used in the video you shared.
    Nr of app in the last 6 months=

    CALCULATE ( DISTINCTCOUNT(FactTable[Original_ID]),
        DATESINPERIOD (
           DimDate[Date],
           EOMONTH( MAX ( DimDate[Date]),-1), -6,
            MONTH
        )
    )