Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Query with subquery also need to filter out while click on month slicer for previous data

Hi all,               Creating a report using Postgresql DB.Table Visual data is loading using folllowing sample query.  select temp.risk_type,temp.expiry_date,temp.effective_date           ...
  • amitchandak's avatar
    3 years ago

    Anonymous , Create an independent date table and so not join it with other dates

     

    then you can have a measure like

     

    //Date1 is independent Date table
    new measure =
    var _max = maxx(allselected(Date1),Date1[Date])
    var _min = minx(allselected(Date1),Date1[Date])

    var _max1 = date(year(_max)+1, Month(_max), Day(_max))
    return
    calculate( sum(Table[Value]), filter('Table', 'Table'[expiry_date] >=_max&& 'Table'[expiry_date] <=_max1 && [effective_date] <= _max ))

     

     

    refer if needed

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